Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save and exit on SIGHUP #18212

Merged
merged 4 commits into from Sep 21, 2016

Conversation

Projects
None yet
3 participants
@xor-ebx-ebx
Copy link
Contributor

commented Sep 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...)

@@ -543,3 +550,25 @@ void exit_handler(int s)
exit( exit_status );
}
}

void hangup_handler(int signum)

This comment has been minimized.

Copy link
@BevapDin

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.

Copy link
@xor-ebx-ebx

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

@mugling mugling self-assigned this Sep 21, 2016

@mugling mugling merged commit 95ecd4b into CleverRaven:master Sep 21, 2016

1 check passed

default This has been rescheduled for testing as the 'master' branch has been updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.