Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upSave and exit on SIGHUP #18212
Conversation
BevapDin
reviewed
Sep 6, 2016
| @@ -543,3 +550,25 @@ void exit_handler(int s) | |||
| exit( exit_status ); | |||
| } | |||
| } | |||
|
|
|||
| void hangup_handler(int signum) | |||
This comment has been minimized.
This comment has been minimized.
BevapDin
Sep 6, 2016
Contributor
The content of this function looks suspiciously similar to that of exit_handler. Is there a need to have a copy of it here, or can it be extracted into a separate function, called from both signal handlers?
The parameter name is inconsistent: in the declaration at the top of the file it's called dummy, here it's called signum, which one is it? If the value of a parameter is not used, just leave out its name (but keep the type):
void handler(int);This allows to get rid of the (void) signum; and shows the intent clearly.
This comment has been minimized.
This comment has been minimized.
xor-ebx-ebx
Sep 7, 2016
Author
Contributor
The parameter names were an oversight on my part. Will be fixed.
As for creating a separate function and calling it from both handlers, this should be possible and probably would be better. I'll give it a try and see how it looks
xor-ebx-ebx commentedSep 6, 2016
This adds a layer of security for people playing over SSH or anything similar and makes Cataclysm behave more like other curses roguelikes (NetHack, Crawl...)