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 | |
parent | bfdabcd985d7528d60b4bf0a2000237339e8f3b3 (diff) |
Fixed a problem with locally-installed dpis.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | dpid/dpi_socket_dir.c | 6 | ||||
-rw-r--r-- | dpid/dpid.c | 6 |
3 files changed, 8 insertions, 6 deletions
@@ -37,6 +37,8 @@ dillo-fltk2 - Improved notification upon leaving links. - Implemented image-link URL showing in status bar. Patches: place ++- Fixed a problem with locally-installed dpis. + Patch: place, Jorge Arellano +- Fixed a va_list-related SEGFAULT on 64bit-arch in dStr_vsprintfa(). Patch: Vincent Thomasset +- Fixed void to int conversions for 64bit-arch. 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; } |