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

Catch ctrl-c call #11

Open
ethandmd opened this issue May 10, 2022 · 2 comments
Open

Catch ctrl-c call #11

ethandmd opened this issue May 10, 2022 · 2 comments

Comments

@ethandmd
Copy link
Owner

#11

@ethandmd
Copy link
Owner Author

Use struct sigaction sa with a handler, and sig action flags to complete cleanup on a ctrl-c call.

@TCCQ
Copy link
Collaborator

TCCQ commented May 17, 2022

read pcap_breakloop for how to break the pcap_loop call to end early and return to our code to rename the interface etc.

It warns that if called from a sig_handler, it may cause the OS to restart the syscall, causing the loop to not stop. Not sure how to indicate a preference to that. Stack Overflow seems to suggest man 7 signal includes some info, but I don't see it from a quick look.

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