diff options
author | jcid <devnull@localhost> | 2007-10-14 02:09:40 +0200 |
---|---|---|
committer | jcid <devnull@localhost> | 2007-10-14 02:09:40 +0200 |
commit | a7aa9b432ee5cd92b6127608d1355b3861aedbf7 (patch) | |
tree | d2ce2b7cb4508aa350b5e015921cac0cf871cb68 /dpid/dpi_socket_dir.c | |
parent | bfdabcd985d7528d60b4bf0a2000237339e8f3b3 (diff) |
Fixed a problem with locally-installed dpis.
Diffstat (limited to 'dpid/dpi_socket_dir.c')
-rw-r--r-- | dpid/dpi_socket_dir.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dpid/dpi_socket_dir.c b/dpid/dpi_socket_dir.c index c18faf0d..27df9296 100644 --- a/dpid/dpi_socket_dir.c +++ b/dpid/dpi_socket_dir.c @@ -21,6 +21,7 @@ */ #include <errno.h> +#include <stdlib.h> #include "dpid_common.h" #include "dpi.h" #include "misc_new.h" @@ -76,9 +77,10 @@ int tst_dir(char *dir) */ char *mk_sockdir(void) { - char *template; + char *template, *logname; - template = dStrconcat("/tmp/", getlogin(), "-", "XXXXXX", NULL); + logname = getenv("LOGNAME") ? getenv("LOGNAME") : "joe"; + template = dStrconcat("/tmp/", logname, "-", "XXXXXX", NULL); if (a_Misc_mkdtemp(template) == NULL) { ERRMSG("mk_sockdir", "a_Misc_mkdtemp", 0); MSG_ERR(" - %s\n", template); |