… | |
… | |
71 | }; |
71 | }; |
72 | |
72 | |
73 | unix_listener::unix_listener (const char *sockname) |
73 | unix_listener::unix_listener (const char *sockname) |
74 | : accept_ev (this, &unix_listener::accept_cb) |
74 | : accept_ev (this, &unix_listener::accept_cb) |
75 | { |
75 | { |
76 | if ((fd = socket (PF_UNIX, SOCK_STREAM, 0)) < 0) |
76 | if ((fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) |
77 | { |
77 | { |
78 | perror ("unable to create listening socket"); |
78 | perror ("unable to create listening socket"); |
79 | exit (EXIT_FAILURE); |
79 | exit (EXIT_FAILURE); |
80 | } |
80 | } |
81 | |
81 | |
… | |
… | |
118 | } |
118 | } |
119 | } |
119 | } |
120 | |
120 | |
121 | int server::getfd (int remote_fd) |
121 | int server::getfd (int remote_fd) |
122 | { |
122 | { |
123 | #if ENABLE_FRILLS && HAVE_UNIX_FDPASS |
|
|
124 | send ("GETFD"); |
123 | send ("GETFD"); |
125 | send (remote_fd); |
124 | send (remote_fd); |
126 | return rxvt_recv_fd (fd); |
125 | return rxvt_recv_fd (fd); |
127 | #else |
|
|
128 | return -1; |
|
|
129 | #endif |
|
|
130 | } |
126 | } |
131 | |
127 | |
132 | void server::log_msg (const char *msg) |
128 | void server::log_msg (const char *msg) |
133 | { |
129 | { |
134 | send ("MSG"), send (msg); |
130 | send ("MSG"), send (msg); |