openbsd-ports/print/cups/patches/patch-scheduler_main_c
mbalmer 7d24d44001 Add a patch from Antti Harri (iku at openbsd dot fi) to prevent cups
from inadvertently shut down OpenBSD and bump the package name.
2005-10-09 10:29:46 +00:00

28 lines
885 B
Plaintext

$OpenBSD: patch-scheduler_main_c,v 1.1 2005/10/09 10:29:47 mbalmer Exp $
--- scheduler/main.c.orig Mon Jan 3 20:29:59 2005
+++ scheduler/main.c Sun Oct 9 12:12:56 2005
@@ -91,6 +91,7 @@ main(int argc, /* I - Number of comm
char *argv[]) /* I - Command-line arguments */
{
int i; /* Looping var */
+ pid_t pidi;
char *opt; /* Option character */
int fg; /* Run in the foreground */
int fds; /* Number of ready descriptors select returns */
@@ -408,8 +409,13 @@ main(int argc, /* I - Number of comm
* we are up and running...
*/
- if (!fg)
- kill(getppid(), SIGUSR1);
+ if (!fg) {
+ pidi = getppid();
+ if (pidi != 1)
+ kill(pidi, SIGUSR1);
+ else
+ syslog(LOG_NOTICE, "parent process is INIT!\n");
+ }
/*
* If the administrator has configured the server to run as an unpriviledged