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.2 by pcg, Mon Nov 24 19:52:16 2003 UTC vs.
Revision 1.3 by pcg, Tue Nov 25 11:52:42 2003 UTC

2 2
3#include <cstdio> 3#include <cstdio>
4#include <cstdlib> 4#include <cstdlib>
5 5
6#include <unistd.h> 6#include <unistd.h>
7#include <signal.h>
7#include <sys/socket.h> 8#include <sys/socket.h>
8#include <sys/un.h> 9#include <sys/un.h>
9 10
10struct client : rxvt_connection { 11struct client : rxvt_connection {
11 client (); 12 client ();
29 perror ("unable to bind listening socket"); 30 perror ("unable to bind listening socket");
30 exit (EXIT_FAILURE); 31 exit (EXIT_FAILURE);
31 } 32 }
32} 33}
33 34
35extern char **environ;
36
34int 37int
35main(int argc, const char *const *argv) 38main(int argc, const char *const *argv)
36{ 39{
37 client c; 40 client c;
38 char buf[PATH_MAX]; 41 char buf[PATH_MAX];
39 42
43 {
44 sigset_t ss;
45
46 sigaddset (&ss, SIGHUP);
47 sigprocmask (SIG_BLOCK, &ss, 0);
48 }
49
40 c.send ("NEW"); 50 c.send ("NEW");
41 c.send ("DISPLAY"), c.send (getenv ("DISPLAY"));
42 // instead of getcwd we could opendir(".") and pass the fd for fchdir *g* 51 // instead of getcwd we could opendir(".") and pass the fd for fchdir *g*
43 c.send ("CWD"), c.send (getcwd (buf, sizeof (buf))); 52 c.send ("CWD"), c.send (getcwd (buf, sizeof (buf)));
53
54 for (char **var = environ; *environ; environ++)
55 c.send ("ENV"), c.send (*environ);
44 56
45 for (int i = 0; i < argc; i++) 57 for (int i = 0; i < argc; i++)
46 c.send ("ARG"), c.send (argv[i]); 58 c.send ("ARG"), c.send (argv[i]);
47 59
48 c.send ("END"); 60 c.send ("END");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines