RE: [LIP] [Update] Sending TERM, and signal handler issue.
"Abdul Faruk" <[email protected]>
| Newsgroups | gmane.user-groups.linux.india.programmers |
|---|---|
| Message-ID | <D435FC6D9FB6F241B1A75DFB53784ADF03A191EA@EMHQ05C.singtel.corp.root> |
On Wed, 2004-10-20 at 10:42, Amarendra Godbole wrote:
> Hi,I had posted this query yesterday about a suspected signal handler
> screwup. I need your inputs to go about this issue, here is a program
> that > >
simulates this behavior -
<snip>
> void term_handle(int signo) {
> printf("Okay, caught %d.\n", signo);
> printf("Going to sleep.\n", signo);
> sleep(15);
> }
>>This is happening as term_handle is called again for SIGTERM before
your program exits.
>>You can add
>>signal(SIGTERM, SIG_IGN); or
>>signal(SIGTERM, SIG_DFL);
>>as the first line of your term_handle function to ignore this signal
or take the default action next time it receives this signal.
At what point you are exitting... Where is exit command. Is the
term_handle is overload alongwith normal code?
I think you might add exit in term_handle.
- Abdul Faruk
- Nirendra
http://www.nirendra.net
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl