-
Notifications
You must be signed in to change notification settings - Fork 1
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
[REFACTOR] Exit for SIGPIPE signal without leaks #356
Conversation
f1a9198
to
eba08ef
Compare
Aahh it's fruststrating that the tester behaves differently in the GitHub Action environment... |
0086930
to
9414521
Compare
By setting up a signal handler that cleans and exits for SIGPIPE, we exit with the first `write()` to a broken pipe without trying over and over again. To avoid memory leaks, allocations in builtins that have not been freed before a call to `write()` have to be safed into the `shell` struct so that they can be freed in the signal handler.
Make environment list operation functions more memory save.
9414521
to
ab18c26
Compare
By setting up a signal handler that cleans and exits for SIGPIPE, we exit with the first
write()
to a broken pipe without trying over and over again.To avoid memory leaks, allocations in builtins that have not been freed before a call to
write()
have to be safed into theshell
struct so that they can be freed in the signal handler.Also:
ft_bzero()
to init shell struct to 0.sa.sa_flags
not matching with the function pointers.