diff options
Diffstat (limited to 'dpid')
-rw-r--r-- | dpid/dpi_socket_dir.c | 6 | ||||
-rw-r--r-- | dpid/dpid.c | 6 |
2 files changed, 6 insertions, 6 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); diff --git a/dpid/dpid.c b/dpid/dpid.c index 9fe2e74d..1bb918ed 100644 --- a/dpid/dpid.c +++ b/dpid/dpid.c @@ -228,7 +228,7 @@ int get_dpi_attr(char *dpi_dir, char *service, struct dp *dpi_attr) } else if ((dir_stream = opendir(service_dir)) == NULL) { ERRMSG("get_dpi_attr", "opendir", errno); } else { - /* Scan the directory loking for dpi files. + /* Scan the directory looking for dpi files. * (currently there's only the dpi program, but in the future * there may also be helper scripts.) */ while ( (dir_entry = readdir(dir_stream)) != NULL) { @@ -330,7 +330,6 @@ int register_all(struct dp **attlist) { DIR *user_dir_stream, *sys_dir_stream; char *user_dpidir = NULL, *sys_dpidir = NULL, *dpidrc = NULL; - char *basename=NULL; struct dirent *user_dirent, *sys_dirent; int j, st, not_in_user_list; int snum, usr_srv_num; @@ -387,8 +386,7 @@ int register_all(struct dp **attlist) continue; not_in_user_list = 1; for (j = 0; j < usr_srv_num; j++) { - basename = get_basename((*attlist)[j].path); - if (strcmp(sys_dirent->d_name, basename) == 0) { + if (strcmp(sys_dirent->d_name, (*attlist)[j].id) == 0) { not_in_user_list = 0; break; } |