Cannot capture SIGPIPE
Hi,
Thanks for the reply. One question that has now started lingering my mind is that Is it correct to pass the kill signal to the process as kill will always try to terminate the process, whereas I do not want to terminate the process.
Secondly, I did have some luck. Ater every write I check for 2 conditions, the return val after write and is errno is set to EPIPE. But still my handler does not get called. Strange!!
Thanks
Parvez
--
--------- Original Message ---------
DATE: Wed, 4 Feb 2004 14:43:16
From: "romesh sahu" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Quoted 38 lines
oh i m sorry for my earlier mail...
i tried sending PIPE instead SIGPIPE...its the same thing happening...both SIGPIPE and PIPE work fine..the process is catching the signal and going toback_to_workand prints the "Not Quitting" message.Regards,
Romesh-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Parvez Pathan
Sent: Wednesday, February 04, 2004 1:23 PM
To: [email protected]
Subject: Cannot capture SIGPIPEHi All,
I have a server program which connect to clients c1 and c2. The server reads from c1 and writes to c2. Whenever c2 dies(or is killed) I get a SIGPIPE at the server. I have tried to capture the SIGPIPE but cant trap it. Some part of my code is as follows:<code>
void cleanup (int x) { printf ("Quitting..."); exit(0); } voidback_to_work(int x) { printf ("Not Quitting..."); return; }main ()
{ signal (SIGINT, cleanup); signal (SIGPIPE, back_to_work); //rest of the program }</code>
The server is in a infinite loop. The server cannot capture a SIGPIPE given to it by the kill command (kill -PIPE <server pid>) also. Am I missing out anything?? Please help.
Thanks,
Parvez
Quoted 8 lines
____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005