]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - pkgs/cups/patches/cups-pid.patch
Change file layout of the makefiles.
[people/ms/ipfire-3.x.git] / pkgs / cups / patches / cups-pid.patch
1 --- cups-1.1.21/scheduler/main.c.pid 2004-09-24 11:29:05.073748138 +0100
2 +++ cups-1.1.21/scheduler/main.c 2004-09-24 11:44:35.826446564 +0100
3 @@ -349,6 +349,8 @@
4 * Setup signal handlers for the parent...
5 */
6
7 + pid_t pid;
8 +
9 #ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
10 sigset(SIGUSR1, parent_handler);
11 sigset(SIGCHLD, parent_handler);
12 @@ -372,7 +374,7 @@
13 signal(SIGHUP, SIG_IGN);
14 #endif /* HAVE_SIGSET */
15
16 - if (fork() > 0)
17 + if ((pid = fork()) > 0)
18 {
19 /*
20 * OK, wait for the child to startup and send us SIGUSR1 or to crash
21 @@ -384,7 +386,15 @@
22 sleep(1);
23
24 if (parent_signal == SIGUSR1)
25 + {
26 + FILE *f = fopen ("/var/run/cupsd.pid", "w");
27 + if (f)
28 + {
29 + fprintf (f, "%d\n", pid);
30 + fclose (f);
31 + }
32 return (0);
33 + }
34
35 if (wait(&i) < 0)
36 {