Skip to content
Snippets Groups Projects
Commit 5efd028d authored by Alexander Turenko's avatar Alexander Turenko Committed by Kirill Yukhin
Browse files

popen: allow to close parent's end of std* fds


The function popen_shutdown() checks whether std{in,out,err} was piped
and closes the parent's end. A user should have ability to send EOF for
child's stdin for stream programs like `grep`. It is better when there
is a function that encapsulates proper checks, error messages and the
actual actions.

This commit in particular reverts
1ef95b99 ('popen: remove redundant fd
check before perform IO'), because now the check is meaningful: an fd
may become closed before the whole popen handle will be deleted.

Part of #4031

Acked-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 55cb9cbe
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment