From 6776c2cdb9091a2f544270df8b17566024960163 Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Tue, 17 Aug 2004 20:01:58 +0000 Subject: [PATCH] do_background: Use O_RDWR when opening the file '/dev/null' for replacement standard streams. --- src/background.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/background.c b/src/background.c index d834712b1..30e86dba7 100644 --- a/src/background.c +++ b/src/background.c @@ -132,7 +132,7 @@ do_background (struct FileOpContext *ctx, char *info) close (1); close (2); - if ((nullfd = open ("/dev/null", O_RDONLY)) != -1) { + if ((nullfd = open ("/dev/null", O_RDWR)) != -1) { while (dup2 (nullfd, 0) == -1 && errno == EINTR); while (dup2 (nullfd, 1) == -1 && errno == EINTR); while (dup2 (nullfd, 2) == -1 && errno == EINTR);