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.14 by root, Fri Dec 14 02:22:24 2007 UTC vs.
Revision 1.17 by sf-exg, Tue Nov 22 13:35:10 2011 UTC

1/*----------------------------------------------------------------------* 1/*----------------------------------------------------------------------*
2 * File: rxvtdaemon.C 2 * File: rxvtdaemon.C
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * 4 *
5 * All portions of code are copyright by their respective author/s. 5 * All portions of code are copyright by their respective author/s.
6 * Copyright (c) 2003-2007 Marc Lehmann <pcg@goof.com> 6 * Copyright (c) 2003-2007 Marc Lehmann <schmorp@schmorp.de>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version. 11 * (at your option) any later version.
25#include <cstdio> 25#include <cstdio>
26 26
27#include <inttypes.h> 27#include <inttypes.h>
28#include <unistd.h> 28#include <unistd.h>
29#include <errno.h> 29#include <errno.h>
30#include <sys/stat.h>
30#include <sys/types.h> 31#include <sys/types.h>
31#include <sys/utsname.h> 32#include <sys/utsname.h>
32#include <limits.h>
33 33
34#include "rxvtdaemon.h" 34#include "rxvtdaemon.h"
35 35
36char *rxvt_connection::unix_sockname () 36char *rxvt_connection::unix_sockname ()
37{ 37{
42 { 42 {
43 struct utsname u; 43 struct utsname u;
44 uname (&u); 44 uname (&u);
45 45
46 path = getenv ("HOME"); 46 path = getenv ("HOME");
47 if (!path)
48 path = "/tmp";
49
50 snprintf (name, PATH_MAX, "%s/.urxvt", path);
51 mkdir (name, 0777);
52
47 snprintf (name, PATH_MAX, "%s/.rxvt-unicode-%s", 53 snprintf (name, PATH_MAX, "%s/.urxvt/urxvtd-%s",
48 path ? path : "/tmp", 54 path,
49 u.nodename); 55 u.nodename);
50 56
51 path = name; 57 path = name;
52 } 58 }
53 59

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines