summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2002-11-21 21:52:59 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2002-11-21 21:52:59 +0000
commit22df8c29e4eb522cb6fa935db73f6bf3a0331869 (patch)
tree91755db832c006d7e1d919976c5f0aca87adc128
parent48df7d401ce888bd04674749abe79a61326caed0 (diff)
downloadtinyproxy-22df8c29e4eb522cb6fa935db73f6bf3a0331869.tar.gz
tinyproxy-22df8c29e4eb522cb6fa935db73f6bf3a0331869.zip
(main): Check to see if the PID file was created successfully, and if
not report this to the user and close the program.
Diffstat (limited to '')
-rw-r--r--src/tinyproxy.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tinyproxy.c b/src/tinyproxy.c
index a4a0c2e..00e8266 100644
--- a/src/tinyproxy.c
+++ b/src/tinyproxy.c
@@ -1,4 +1,4 @@
-/* $Id: tinyproxy.c,v 1.40 2002-11-03 17:10:32 rjkaes Exp $
+/* $Id: tinyproxy.c,v 1.41 2002-11-21 21:52:59 rjkaes Exp $
*
* The initialize routine. Basically sets up all the initial stuff (logfile,
* listening socket, config options, etc.) and then sits there and loops
@@ -278,7 +278,11 @@ main(int argc, char **argv)
makedaemon();
if (config.pidpath) {
- pidfile_create(config.pidpath);
+ if (pidfile_create(config.pidpath) < 0) {
+ fprintf(stderr, "%s: Could not create PID file.\n",
+ argv[0]);
+ exit(EX_OSERR);
+ }
}
if (set_signal_handler(SIGPIPE, SIG_IGN) == SIG_ERR) {