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

Comparing rxvt-unicode/src/rxvtdaemon.C (file contents):
Revision 1.2 by pcg, Mon Nov 24 19:52:16 2003 UTC vs.
Revision 1.5 by pcg, Wed Mar 17 05:15:02 2004 UTC

1#include <unistd.h>
2#include <stdint.h> 1#include <stdint.h>
3#include <cstdlib> 2#include <cstdlib>
4#include <cstring> 3#include <cstring>
4#include <cstdio>
5
6#include <unistd.h>
7#include <sys/utsname.h>
8#include <limits.h>
5 9
6#include "rxvtdaemon.h" 10#include "rxvtdaemon.h"
7 11
8const char *rxvt_connection::unix_sockname () 12char *rxvt_connection::unix_sockname ()
9{ 13{
10 return "/tmp/rxvtd~"; 14 char name[PATH_MAX];
15 char *path = getenv ("RXVT_SOCKET");
16
17 if (!path)
18 {
19 struct utsname u;
20 uname (&u);
21
22 path = getenv ("HOME");
23 snprintf (name, PATH_MAX, "%s/.rxvt-%s",
24 path ? path : "/tmp",
25 u.nodename);
26
27 path = name;
28 }
29
30 return strdup (path);
11} 31}
12 32
13void rxvt_connection::send (const char *data, int len) 33void rxvt_connection::send (const char *data, int len)
14{ 34{
15 uint8_t s[2]; 35 uint8_t s[2];
55 75
56void rxvt_connection::send (int data) 76void rxvt_connection::send (int data)
57{ 77{
58 uint8_t s[4]; 78 uint8_t s[4];
59 79
60 s[0] = data >> 24; s[1] = data >> 16; s[0] = data >> 8; s[1] = data; 80 s[0] = data >> 24; s[1] = data >> 16; s[2] = data >> 8; s[3] = data;
61 81
62 write (fd, s, 4); 82 write (fd, s, 4);
63} 83}
64 84
65bool rxvt_connection::recv (int &data) 85bool rxvt_connection::recv (int &data)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines