stdin is supposed to be readable, stdout and stderr writable. Otherwise, we get this:
l-wx------. 1 root root 64 Apr 19 18:40 0 -> /dev/full lr-x------. 1 root root 64 Apr 19 18:40 1 -> /dev/null lr-x------. 1 root root 64 Apr 19 18:40 2 -> /dev/null Signed-off-by: Sergey Bugaev <buga...@gmail.com> --- csu/check_fds.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csu/check_fds.c b/csu/check_fds.c index de6dd716..ca4812cd 100644 --- a/csu/check_fds.c +++ b/csu/check_fds.c @@ -90,7 +90,7 @@ __libc_check_standard_fds (void) is really paranoid but some people actually are. If /dev/null should happen to be a symlink to somewhere else and not the device commonly known as "/dev/null" we bail out. */ - check_one_fd (STDIN_FILENO, O_WRONLY | O_NOFOLLOW); - check_one_fd (STDOUT_FILENO, O_RDONLY | O_NOFOLLOW); - check_one_fd (STDERR_FILENO, O_RDONLY | O_NOFOLLOW); + check_one_fd (STDIN_FILENO, O_RDONLY | O_NOFOLLOW); + check_one_fd (STDOUT_FILENO, O_WRONLY | O_NOFOLLOW); + check_one_fd (STDERR_FILENO, O_WRONLY | O_NOFOLLOW); } -- 2.40.0