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.25 by root, Mon Feb 20 22:42:00 2006 UTC vs.
Revision 1.27 by root, Fri Aug 18 23:03:31 2006 UTC

43 client (); 43 client ();
44}; 44};
45 45
46client::client () 46client::client ()
47{ 47{
48 sockaddr_un sa;
49 char *sockname = rxvt_connection::unix_sockname ();
50
51 if (strlen(sockname) >= sizeof(sa.sun_path))
52 {
53 fputs ("socket name too long, aborting.\n", stderr);
54 exit (STATUS_FAILURE);
55 }
56
48 if ((fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) 57 if ((fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
49 { 58 {
50 perror ("unable to create communications socket"); 59 perror ("unable to create communications socket");
51 exit (STATUS_FAILURE); 60 exit (STATUS_FAILURE);
52 } 61 }
53 62
54 char *sockname = rxvt_connection::unix_sockname ();
55 sockaddr_un sa;
56 sa.sun_family = AF_UNIX; 63 sa.sun_family = AF_UNIX;
57 strcpy (sa.sun_path, sockname); 64 strcpy (sa.sun_path, sockname);
58 free (sockname); 65 free (sockname);
59 66
60 if (connect (fd, (sockaddr *)&sa, sizeof (sa))) 67 if (connect (fd, (sockaddr *)&sa, sizeof (sa)))
73 { 80 {
74 sigset_t ss; 81 sigset_t ss;
75 82
76 sigemptyset (&ss); 83 sigemptyset (&ss);
77 sigaddset (&ss, SIGHUP); 84 sigaddset (&ss, SIGHUP);
85 sigaddset (&ss, SIGPIPE);
78 sigprocmask (SIG_BLOCK, &ss, 0); 86 sigprocmask (SIG_BLOCK, &ss, 0);
79 } 87 }
80 88
81 c.send ("NEW"); 89 c.send ("NEW");
82 90

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines