diff options
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); |