Search
j0ke.net Open Build Service
>
Projects
>
ha
:
firewall
>
packetbl
> packetbl-write-pid.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File packetbl-write-pid.patch of Package packetbl (Revision 2)
Currently displaying revision
2
,
show latest
--- packetbl.c.orig.new 2011-01-09 17:01:09.731766866 +0100 +++ packetbl.c 2011-01-09 17:16:18.788122324 +0100 @@ -230,6 +230,7 @@ void daemonize(void) { pid_t pid; + FILE *pidf; chdir("/"); @@ -242,6 +243,13 @@ pid = fork(); if (pid > 0) { + pidf = fopen ("/var/run/packetbl/packetbl.pid", "w"); + if (!pidf) { + syslog(LOG_ERR, "Can't write PID %d to /var/run/packetbl/packetbl.pid", (int)pid); + } else { + fprintf(pidf, "%d\n", (int)pid); + fclose(pidf); + } exit(EXIT_SUCCESS); } if (pid < 0) {