ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtc.C
(Generate patch)

Comparing rxvt-unicode/src/rxvtc.C (file contents):
Revision 1.19 by root, Tue Jan 10 04:23:39 2006 UTC vs.
Revision 1.22 by root, Sun Jan 22 16:36:40 2006 UTC

19 * along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 *----------------------------------------------------------------------*/ 21 *----------------------------------------------------------------------*/
22 22
23#include "../config.h" 23#include "../config.h"
24#include "rxvtdaemon.h"
25#include "fdpass.h"
26
27#include "rxvt.h"
28
29#include <cstdio> 24#include <cstdio>
30#include <cstdlib> 25#include <cstdlib>
31#include <cstring> 26#include <cstring>
32#include <csignal> 27#include <csignal>
33 28
34#include <unistd.h> 29#include <unistd.h>
35#include <sys/socket.h> 30#include <sys/socket.h>
36#include <sys/un.h> 31#include <sys/un.h>
37 32
33#include "rxvtdaemon.h"
34#include "libptytty.h"
35
36#include "rxvt.h"
37
38struct client : rxvt_connection { 38struct client : rxvt_connection {
39 client (); 39 client ();
40}; 40};
41 41
42client::client () 42client::client ()
43{ 43{
44 if ((fd = socket (PF_UNIX, SOCK_STREAM, 0)) < 0) 44 if ((fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
45 { 45 {
46 perror ("unable to create communications socket"); 46 perror ("unable to create communications socket");
47 exit (EXIT_FAILURE); 47 exit (EXIT_FAILURE);
48 } 48 }
49 49
108 fprintf (stderr, "protocol error: unexpected eof from server.\n"); 108 fprintf (stderr, "protocol error: unexpected eof from server.\n");
109 break; 109 break;
110 } 110 }
111 else if (!strcmp (tok, "MSG") && c.recv (tok)) 111 else if (!strcmp (tok, "MSG") && c.recv (tok))
112 fprintf (stderr, "%s", (const char *)tok); 112 fprintf (stderr, "%s", (const char *)tok);
113#if ENABLE_FRILLS && HAVE_UNIX_FDPASS
114 else if (!strcmp (tok, "GETFD") && c.recv (cint)) 113 else if (!strcmp (tok, "GETFD") && c.recv (cint))
115 { 114 {
116 if (rxvt_send_fd (c.fd, cint) < 0) 115 if (!ptytty::send_fd (c.fd, cint))
117 { 116 {
118 fprintf (stderr, "unable to send fd %d: ", cint); perror (0); 117 fprintf (stderr, "unable to send fd %d: ", cint); perror (0);
119 exit (EXIT_FAILURE); 118 exit (EXIT_FAILURE);
120 } 119 }
121 } 120 }
122#endif
123 else if (!strcmp (tok, "END")) 121 else if (!strcmp (tok, "END"))
124 { 122 {
125 int success; 123 int success;
126 124
127 if (c.recv (success)) 125 if (c.recv (success))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines