* background.c (do_background): Fixed file descriptor leak.
Этот коммит содержится в:
родитель
243e84706e
Коммит
b86b6a7bc7
@ -1,3 +1,7 @@
|
||||
2004-08-29 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* background.c (do_background): Fixed file descriptor leak.
|
||||
|
||||
2004-08-29 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* Code cleanup: Added const qualifier for variables and
|
||||
|
@ -116,8 +116,13 @@ do_background (struct FileOpContext *ctx, char *info)
|
||||
if (pipe (comm) == -1)
|
||||
return -1;
|
||||
|
||||
if ((pid = fork ()) == -1)
|
||||
if ((pid = fork ()) == -1) {
|
||||
int saved_errno = errno;
|
||||
(void) close (comm[0]);
|
||||
(void) close (comm[1]);
|
||||
errno = saved_errno;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pid == 0) {
|
||||
int nullfd;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user