I'm trying to debug the cleanup section of my filter when it get a
SIGTERM (e.g. canceling the job from the printer proxy) and I've
found that I get a SIGPIPE on the next fprintf to stderr and none of
my debug output after that makes it to the cups log.
I've implemented the following code for signal handling:
struct sigaction action;
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_sigaction = signalHandler;
action.sa_flags |= SA_SIGINFO | SA_RESTART;
if (sigaction(SIGTERM, &action, NULL) < 0)
perror("DEBUG: Failed to set SIGTERM handler");
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_sigaction = signalHandler;
action.sa_flags |= SA_SIGINFO | SA_RESTART;
if (sigaction(SIGPIPE, &action, NULL) < 0)
perror("DEBUG: Failed to set SIGPIPE handler");
With that I no longer get the SIGPIPE alert in gdb, but I still don't
get my debug data either.
Is this normal for Tiger? I wasn't that way in Panther as far as I
can remember. Or did I botch my signal handling somehow?
Thanks,
Dave
---
The path of least resistance, it's not just for electricity any more.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Printing mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/printing/email@hidden