diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-02 22:32:11 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:47:15 +0100 |
commit | 6c999cd12344f2bb8b1d2941210b4c205b3e0aad (patch) | |
tree | 0911e4ca75694e080173c2863e2c41ff5881309c /source4/smbd/pidfile.c | |
parent | 934e932387ea5668ec000bcefe4ec86935297339 (diff) | |
download | samba-6c999cd12344f2bb8b1d2941210b4c205b3e0aad.tar.gz samba-6c999cd12344f2bb8b1d2941210b4c205b3e0aad.tar.bz2 samba-6c999cd12344f2bb8b1d2941210b4c205b3e0aad.zip |
r26236: Remove more uses of global_loadparm or specify loadparm_context explicitly.
(This used to be commit 5b29ef7c03d9ae76b0ca909e9f03a58e1bad3521)
Diffstat (limited to 'source4/smbd/pidfile.c')
-rw-r--r-- | source4/smbd/pidfile.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/smbd/pidfile.c b/source4/smbd/pidfile.c index 4847ddd7b5..3567846070 100644 --- a/source4/smbd/pidfile.c +++ b/source4/smbd/pidfile.c @@ -33,14 +33,14 @@ * return the pid in a pidfile. return 0 if the process (or pidfile) * does not exist */ -pid_t pidfile_pid(const char *name) +pid_t pidfile_pid(const char *piddir, const char *name) { int fd; char pidstr[20]; pid_t ret; char *pidFile; - asprintf(&pidFile, "%s/%s.pid", lp_piddir(global_loadparm), name); + asprintf(&pidFile, "%s/%s.pid", piddir, name); fd = open(pidFile, O_NONBLOCK | O_RDONLY, 0644); @@ -80,16 +80,16 @@ pid_t pidfile_pid(const char *name) /** * create a pid file in the pid directory. open it and leave it locked */ -void pidfile_create(const char *name) +void pidfile_create(const char *piddir, const char *name) { int fd; char buf[20]; char *pidFile; pid_t pid; - asprintf(&pidFile, "%s/%s.pid", lp_piddir(global_loadparm), name); + asprintf(&pidFile, "%s/%s.pid", piddir, name); - pid = pidfile_pid(name); + pid = pidfile_pid(piddir, name); if (pid != 0) { DEBUG(0,("ERROR: %s is already running. File %s exists and process id %d is running.\n", name, pidFile, (int)pid)); |