From 22df8c29e4eb522cb6fa935db73f6bf3a0331869 Mon Sep 17 00:00:00 2001 From: Robert James Kaes Date: Thu, 21 Nov 2002 21:52:59 +0000 Subject: (main): Check to see if the PID file was created successfully, and if not report this to the user and close the program. --- src/tinyproxy.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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) { -- cgit v1.2.3