From d6601f8cff2d95376ea79394dd7373564c754835 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Wed, 19 Nov 2003 22:45:06 +0000 Subject: make pidfile default to null rather than writing to your cwd svn:r853 --- src/or/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/or/main.c') diff --git a/src/or/main.c b/src/or/main.c index a19079ddf..52242653f 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -628,8 +628,8 @@ static int init_from_config(int argc, char **argv) { } /* write our pid to the pid file, if we do not have write permissions we will log a warning */ - write_pidfile(options.PidFile); - /* XXX Is overwriting the pidfile ok? I think it is. -RD */ + if(options.PidFile) + write_pidfile(options.PidFile); return 0; } @@ -750,7 +750,8 @@ static void catch(int the_signal) { log(LOG_ERR,"Catching signal %d, exiting cleanly.", the_signal); /* we don't care if there was an error when we unlink, nothing we could do about it anyways */ - unlink(options.PidFile); + if(options.PidFile) + unlink(options.PidFile); exit(0); case SIGHUP: please_reset = 1; -- cgit v1.2.3