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.36 by root, Sat Nov 17 07:28:00 2007 UTC vs.
Revision 1.41 by root, Tue Dec 4 16:24:00 2007 UTC

46 void read_cb (ev::io &w, int revents); ev::io read_ev; 46 void read_cb (ev::io &w, int revents); ev::io read_ev;
47 void log_msg (const char *msg); 47 void log_msg (const char *msg);
48 int getfd (int remote_fd); 48 int getfd (int remote_fd);
49 49
50 server (int fd) 50 server (int fd)
51 : read_ev (this, &server::read_cb),
52 log_cb (this, &server::log_msg),
53 getfd_cb (this, &server::getfd)
54 { 51 {
52 read_ev.set <server, &server::read_cb> (this);
53 log_cb.set <server, &server::log_msg> (this);
54 getfd_cb.set<server, &server::getfd> (this);
55
56 this->fd = fd;
55 fcntl (fd, F_SETFD, FD_CLOEXEC); 57 fcntl (fd, F_SETFD, FD_CLOEXEC);
56 fcntl (fd, F_SETFL, 0); 58 fcntl (fd, F_SETFL, 0);
57 read_ev.start (fd, ev::READ); 59 read_ev.start (fd, ev::READ);
58 } 60 }
59 61
67 69
68 unix_listener (const char *sockname); 70 unix_listener (const char *sockname);
69}; 71};
70 72
71unix_listener::unix_listener (const char *sockname) 73unix_listener::unix_listener (const char *sockname)
72: accept_ev (this, &unix_listener::accept_cb)
73{ 74{
75 accept_ev.set<unix_listener, &unix_listener::accept_cb> (this);
76
74 sockaddr_un sa; 77 sockaddr_un sa;
75 78
76 if (strlen (sockname) >= sizeof(sa.sun_path)) 79 if (strlen (sockname) >= sizeof(sa.sun_path))
77 { 80 {
78 fputs ("socket name too long, aborting.\n", stderr); 81 fputs ("socket name too long, aborting.\n", stderr);
270 rxvt_log ("unable to fork daemon, aborting.\n"); 273 rxvt_log ("unable to fork daemon, aborting.\n");
271 return EXIT_FAILURE; 274 return EXIT_FAILURE;
272 } 275 }
273 else if (pid > 0) 276 else if (pid > 0)
274 _exit (EXIT_SUCCESS); 277 _exit (EXIT_SUCCESS);
275 }
276 278
279 ev_default_fork ();
280 }
281
277 ev::ev_loop (0); 282 ev_loop (0);
278 283
279 return EXIT_SUCCESS; 284 return EXIT_SUCCESS;
280} 285}
281 286

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines