]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - cups/patches/010_cups-pid.patch
libtevent: Update to version 0.9.30
[people/ms/ipfire-3.x.git] / cups / patches / 010_cups-pid.patch
CommitLineData
1f9b7ef8
KB
1diff -up cups-1.5b1/scheduler/main.c.pid cups-1.5b1/scheduler/main.c
2--- cups-1.5b1/scheduler/main.c.pid 2011-05-18 22:44:16.000000000 +0200
3+++ cups-1.5b1/scheduler/main.c 2011-05-23 18:01:20.000000000 +0200
4@@ -311,6 +311,8 @@ main(int argc, /* I - Number of comm
f92713d3
SS
5 * Setup signal handlers for the parent...
6 */
7
8+ pid_t pid;
9+
10 #ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
11 sigset(SIGUSR1, parent_handler);
12 sigset(SIGCHLD, parent_handler);
1f9b7ef8 13@@ -334,7 +336,7 @@ main(int argc, /* I - Number of comm
f92713d3
SS
14 signal(SIGHUP, SIG_IGN);
15 #endif /* HAVE_SIGSET */
16
17- if (fork() > 0)
18+ if ((pid = fork()) > 0)
19 {
20 /*
21 * OK, wait for the child to startup and send us SIGUSR1 or to crash
1f9b7ef8 22@@ -346,7 +348,15 @@ main(int argc, /* I - Number of comm
f92713d3
SS
23 sleep(1);
24
25 if (parent_signal == SIGUSR1)
26+ {
27+ FILE *f = fopen ("/var/run/cupsd.pid", "w");
28+ if (f)
29+ {
30+ fprintf (f, "%d\n", pid);
31+ fclose (f);
32+ }
33 return (0);
34+ }
35
36 if (wait(&i) < 0)
37 {