forked from github/abduco
Check return value of open(2) #30720
This commit is contained in:
parent
bb7c859b5f
commit
d1a44a9c1a
3
abduco.c
3
abduco.c
|
|
@ -347,9 +347,12 @@ static bool create_session(const char *name, char * const argv[]) {
|
||||||
chdir("/");
|
chdir("/");
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
int fd = open("/dev/null", O_RDWR);
|
int fd = open("/dev/null", O_RDWR);
|
||||||
|
if (fd != -1) {
|
||||||
dup2(fd, 0);
|
dup2(fd, 0);
|
||||||
dup2(fd, 1);
|
dup2(fd, 1);
|
||||||
dup2(fd, 2);
|
dup2(fd, 2);
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
#endif /* NDEBUG */
|
#endif /* NDEBUG */
|
||||||
close(client_pipe[1]);
|
close(client_pipe[1]);
|
||||||
close(server_pipe[1]);
|
close(server_pipe[1]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue