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

Add signal handler to yes.c #31

Open
su8 opened this issue Dec 22, 2017 · 2 comments
Open

Add signal handler to yes.c #31

su8 opened this issue Dec 22, 2017 · 2 comments

Comments

@su8
Copy link

su8 commented Dec 22, 2017

Example: https://github.com/su8/iu-coreutils/blob/master/yes.c

@emmiegit
Copy link
Owner

Why does yes need a signal handler? If it receieves SIGPIPE the default action is to die, no?

@su8
Copy link
Author

su8 commented Dec 23, 2017

Why does yes need a signal handler?

To exit gracefully, so we don't end up allocating memory in the middle and interup the program without freeing it.

If it receieves SIGPIPE the default action is to die, no?

Can you test this since the program ismrunning in a infinite loop. Just raise() the signal and see what happens. I don't have computer around to test this.

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