summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d433ed0)
raw | patch | inline | side by side (parent: d433ed0)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 22 Nov 2008 23:21:52 +0000 (00:21 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 24 Nov 2008 03:56:36 +0000 (19:56 -0800) |
Remove the global variable 'directory' and pass it as a parameter of
the two functions that use it instead, (almost) restoring their
interface to how it was before 49ba83fb67d9e447b86953965ce5f949c6a93b81.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
the two functions that use it instead, (almost) restoring their
interface to how it was before 49ba83fb67d9e447b86953965ce5f949c6a93b81.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
daemon.c | patch | blob | history |
diff --git a/daemon.c b/daemon.c
index fbf61ca4d59e73ed918bc5a23b56b6c9f2d3751e..1cef3098d2bd2fb28e2b670ac26c41eebf37dc78 100644 (file)
--- a/daemon.c
+++ b/daemon.c
static char *canon_hostname;
static char *ip_address;
static char *tcp_port;
-static char *directory;
static void logreport(int priority, const char *err, va_list params)
{
}
}
-static char *path_ok(void)
+static char *path_ok(char *directory)
{
static char rpath[PATH_MAX];
static char interp_path[PATH_MAX];
return 0;
}
-static int run_service(struct daemon_service *service)
+static int run_service(char *dir, struct daemon_service *service)
{
const char *path;
int enabled = service->enabled;
- loginfo("Request %s for '%s'", service->name, directory);
+ loginfo("Request %s for '%s'", service->name, dir);
if (!enabled && !service->overridable) {
logerror("'%s': service not enabled.", service->name);
return -1;
}
- if (!(path = path_ok()))
+ if (!(path = path_ok(dir)))
return -1;
/*
free(canon_hostname);
free(ip_address);
free(tcp_port);
- free(directory);
- hostname = canon_hostname = ip_address = tcp_port = directory = NULL;
+ hostname = canon_hostname = ip_address = tcp_port = NULL;
if (len != pktlen)
parse_extra_args(line + len + 1, pktlen - len - 1);
* Note: The directory here is probably context sensitive,
* and might depend on the actual service being performed.
*/
- free(directory);
- directory = xstrdup(line + namelen + 5);
- return run_service(s);
+ return run_service(line + namelen + 5, s);
}
}