1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-04 21:12:47 -05:00

Centralise calls to fcntl into functions that carefully check the

error returns.

[originally from svn r9940]
This commit is contained in:
Simon Tatham
2013-07-19 18:10:02 +00:00
parent 96f3589e16
commit b426872219
7 changed files with 76 additions and 31 deletions

View File

@ -306,8 +306,8 @@ Socket platform_new_connection(SockAddr addr, char *hostname,
dup2(from_cmd_pipe[1], 1);
close(to_cmd_pipe[0]);
close(from_cmd_pipe[1]);
fcntl(0, F_SETFD, 0);
fcntl(1, F_SETFD, 0);
noncloexec(0);
noncloexec(1);
execl("/bin/sh", "sh", "-c", cmd, (void *)NULL);
_exit(255);
}