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

Implement proper signal handling and exiting #2

Open
kragniz opened this issue Feb 21, 2016 · 4 comments
Open

Implement proper signal handling and exiting #2

kragniz opened this issue Feb 21, 2016 · 4 comments

Comments

@kragniz
Copy link
Member

kragniz commented Feb 21, 2016

C-c currently just calls exit(1). This should be improved to cleanly close sockets, write to files and things.

@Danyc0
Copy link
Contributor

Danyc0 commented Oct 20, 2016

The program already seems catch the SIGINT here:
https://github.com/sails-simulator/sailsd/blob/master/sailsd.c#L382-L386
So is it just that the code for closing the sockets needs to happen here?

@kragniz
Copy link
Member Author

kragniz commented Oct 20, 2016

Yes, it's a question of getting the file handler for the socket (https://github.com/sails-simulator/sailsd/blob/master/sailsd.c#L435) into that scope, then dealing with it.

@Danyc0
Copy link
Contributor

Danyc0 commented Oct 20, 2016

Looks like the only way to do that is to put the socket descriptor in the module scope, right? because there's no other way to get a variable into a signal handlers scope

@kragniz
Copy link
Member Author

kragniz commented Oct 20, 2016

Yup, something like that would need to be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants