-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad exit code when failing to start server #718
Comments
CUPS.org User: mike Try the attached patch... |
CUPS.org User: mike Fixed in CVS - the anonymous CVS repository will be updated at midnight EST. |
"cups-startup.patch": --- cups-1.1.20/scheduler/main.c.startup 2004-05-19 11:12:27.292051852 +0100
|
"str718.patch": Index: main.cRCS file: /development/cvs/cups/scheduler/main.c,v
@@ -1008,11 +1014,12 @@
|
Version: 1.1.20
CUPS.org User: twaugh.redhat
If cupsd fails to bind to a port it wants to listen on it exits with an incorrect exit code.
The cupsd binary forks off the server and waits for SIGUSR1 to indicate that it is up and running. In the mean time it handles exit codes, but exits with the status value it got from wait(). Instead it should use WEXITSTATUS and the WIF* macros.
The reason this is a problem is that exit codes are 8 bits, but wait() status values for normal exit are clear in the low 8 bits.
Attached is a minimal patch to fix it. Really it ought to use WEXITSTATUS and WIF* I think.
The text was updated successfully, but these errors were encountered: