#Process does not properly handle SIGINT

11 messages · Page 1 of 1 (latest)

storm roost
#

I am trying to get a process to ignore SIGINT. I have set the handler to an empty function, but the program still ends when I press CTRL+C. I put a call to puts inside the handler and it was executed. exit is not being called anywhere so I do not think that it makes sense that my program is ending. Here is some code that illustrates very basically what my program is doing. I can show more if necessary: https://pastebin.com/0vD5TseN

stark treeBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

visual ore
storm roost
visual ore
# storm roost If it doesn't produce any signal, then how does it terminate the process?

No clue.
I simply summarized a comment on the SO post:

There's no such thing as catching signals in C.... or at least so I thought until I read the C99 standard. It turns out that there is signal handling defined in C but Ctrl-C isn't mandated to produce any specific signal or a signal at all. Depending on your platform, this might be impossible.

But upon researching I couldn't find anything else, besides someone who said that Ctrl + C could also send SIGTERM.

...And upon even further research it appears that that's apparently only for customly configured terminals.

I'll look at it once I get home in case noone else answers.

#

*I'll look at it once I got home, finished my homework and if I have some time and energy left by then

storm roost
#

Actually, the signal catching worked several weeks ago.

#

Recently it has stopped working though.

stark treeBOT
#

@storm roost Has your question been resolved? If so, run !solved :)

storm roost
#

!solved