summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorAndreas Eversberg2009-03-15 10:19:45 +0100
committerAndreas Eversberg2009-03-15 10:19:45 +0100
commitb2f6c87b1b020e4ac30658422bb144ee3f05a842 (patch)
tree53c5cb1e6579d574d4542583fdbcc6cc81b00a92 /main.c
parentFixed dtmf detection of A-D. (thanx to Ralf) (diff)
downloadlcr-b2f6c87b1b020e4ac30658422bb144ee3f05a842.tar.gz
lcr-b2f6c87b1b020e4ac30658422bb144ee3f05a842.tar.xz
lcr-b2f6c87b1b020e4ac30658422bb144ee3f05a842.zip
Check if pid file did not open.
modified: main.c
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main.c b/main.c
index 73cfe49..51da4a1 100644
--- a/main.c
+++ b/main.c
@@ -348,8 +348,11 @@ int main(int argc, char *argv[])
/* write pid file */
pidfile = fopen("/var/run/lcr.pid","w");
- fprintf(pidfile, "%d\n", getpid());
- fclose(pidfile);
+ if (pidfile)
+ {
+ fprintf(pidfile, "%d\n", getpid());
+ fclose(pidfile);
+ }
} else
/* if not start */
if (!!strcasecmp(argv[1],"start"))