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

Comparing rxvt-unicode/src/rxvtd.C (file contents):
Revision 1.34 by root, Sun Nov 11 04:08:00 2007 UTC vs.
Revision 1.35 by root, Sat Nov 17 07:26:54 2007 UTC

51 : read_ev (this, &server::read_cb), 51 : read_ev (this, &server::read_cb),
52 log_cb (this, &server::log_msg), 52 log_cb (this, &server::log_msg),
53 getfd_cb (this, &server::getfd) 53 getfd_cb (this, &server::getfd)
54 { 54 {
55 this->fd = fd; 55 this->fd = fd;
56 fcntl (fd, F_SETFD, FD_CLOEXEC);
57 fcntl (fd, F_SETFL, 0);
56 read_ev.start (fd, ev::READ); 58 read_ev.start (fd, ev::READ);
57 } 59 }
58 60
59 void err (const char *format = 0, ...); 61 void err (const char *format = 0, ...);
60}; 62};
83 perror ("unable to create listening socket"); 85 perror ("unable to create listening socket");
84 exit (EXIT_FAILURE); 86 exit (EXIT_FAILURE);
85 } 87 }
86 88
87 fcntl (fd, F_SETFD, FD_CLOEXEC); 89 fcntl (fd, F_SETFD, FD_CLOEXEC);
90 fcntl (fd, F_SETFL, O_NONBLOCK);
88 91
89 sa.sun_family = AF_UNIX; 92 sa.sun_family = AF_UNIX;
90 strcpy (sa.sun_path, sockname); 93 strcpy (sa.sun_path, sockname);
91 94
92 unlink (rxvt_connection::unix_sockname ()); 95 unlink (rxvt_connection::unix_sockname ());
113void unix_listener::accept_cb (ev::io &w, int revents) 116void unix_listener::accept_cb (ev::io &w, int revents)
114{ 117{
115 int fd2 = accept (fd, 0, 0); 118 int fd2 = accept (fd, 0, 0);
116 119
117 if (fd2 >= 0) 120 if (fd2 >= 0)
118 {
119 fcntl (fd2, F_SETFD, FD_CLOEXEC);
120 new server (fd2); 121 new server (fd2);
121 }
122} 122}
123 123
124int server::getfd (int remote_fd) 124int server::getfd (int remote_fd)
125{ 125{
126 send ("GETFD"); 126 send ("GETFD");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines