Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Kill sibling process when a pipe is broken #10

Open
tyfkda opened this issue Jul 18, 2018 · 1 comment
Open

Kill sibling process when a pipe is broken #10

tyfkda opened this issue Jul 18, 2018 · 1 comment

Comments

@tyfkda
Copy link
Owner

tyfkda commented Jul 18, 2018

$ cat nofile | wc
cat: cannot open nofile
0 0 0  # <= This line is printed by wc, but it shouldn't.
@takeharukato
Copy link

takeharukato commented Aug 13, 2018

Hi,

In my understanding, we should introduce SIGPIPE signal to kill a parent process when its pipe is broken.
It might be a proper solution to achieve what you want if we set its default behavior as terminating a process.

It might be preferable to implement a signal handling mechanism ( #11 ) beforehand.

Thanks,
Regards,

@tyfkda tyfkda changed the title Kill parent process when child is dead with abnormal code Kill sibling process when pipe is broken Aug 14, 2018
@tyfkda tyfkda changed the title Kill sibling process when pipe is broken Kill sibling process when a pipe is broken Aug 14, 2018
tyfkda added a commit that referenced this issue Aug 14, 2018
Before implementing signals and `SIGPIPE`,
just use `exit` function to kill the process abnormally. #10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants