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.21 by root, Thu Jul 7 19:37:47 2005 UTC vs.
Revision 1.22 by root, Fri Dec 23 14:46:35 2005 UTC

21 *----------------------------------------------------------------------*/ 21 *----------------------------------------------------------------------*/
22 22
23#include "../config.h" 23#include "../config.h"
24#include "rxvt.h" 24#include "rxvt.h"
25#include "rxvtdaemon.h" 25#include "rxvtdaemon.h"
26#include "fdpass.h"
26#include "iom.h" 27#include "iom.h"
27 28
28#include <cstdio> 29#include <cstdio>
29#include <cstdlib> 30#include <cstdlib>
30#include <cstdarg> 31#include <cstdarg>
41 42
42extern char **environ; 43extern char **environ;
43 44
44struct server : rxvt_connection { 45struct server : rxvt_connection {
45 log_callback log_cb; 46 log_callback log_cb;
47 getfd_callback getfd_cb;
46 48
47 void read_cb (io_watcher &w, short revents); io_watcher read_ev; 49 void read_cb (io_watcher &w, short revents); io_watcher read_ev;
48 void log_msg (const char *msg); 50 void log_msg (const char *msg);
51 int getfd (int remote_fd);
49 52
50 server (int fd) 53 server (int fd)
51 : read_ev (this, &server::read_cb), 54 : read_ev (this, &server::read_cb),
52 log_cb (this, &server::log_msg) 55 log_cb (this, &server::log_msg),
56 getfd_cb (this, &server::getfd)
53 { 57 {
54 this->fd = fd; 58 this->fd = fd;
55 read_ev.start (fd, EVENT_READ); 59 read_ev.start (fd, EVENT_READ);
56 } 60 }
57 61
110 if (fd2 >= 0) 114 if (fd2 >= 0)
111 { 115 {
112 fcntl (fd2, F_SETFD, FD_CLOEXEC); 116 fcntl (fd2, F_SETFD, FD_CLOEXEC);
113 new server (fd2); 117 new server (fd2);
114 } 118 }
119}
120
121int server::getfd (int remote_fd)
122{
123#if ENABLE_FRILLS && HAVE_UNIX_FDPASS
124 send ("GETFD");
125 send (remote_fd);
126 return rxvt_recv_fd (fd);
127#else
128 return -1;
129#endif
115} 130}
116 131
117void server::log_msg (const char *msg) 132void server::log_msg (const char *msg)
118{ 133{
119 send ("MSG"), send (msg); 134 send ("MSG"), send (msg);
177 environ = envv->begin (); 192 environ = envv->begin ();
178 193
179 rxvt_term *term = new rxvt_term; 194 rxvt_term *term = new rxvt_term;
180 195
181 term->log_hook = &log_cb; 196 term->log_hook = &log_cb;
197 term->getfd_hook = &getfd_cb;
182 term->argv = argv; 198 term->argv = argv;
183 term->envv = envv; 199 term->envv = envv;
184 200
185 bool success; 201 bool success;
186 202

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines