1
1

* background.c (do_background): Fixed file descriptor leak.

Этот коммит содержится в:
Roland Illig 2004-08-29 18:57:31 +00:00
родитель 243e84706e
Коммит b86b6a7bc7
2 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -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;