mirror of https://github.com/MidnightCommander/mc
do_background: Use O_RDWR when opening the file '/dev/null'
for replacement standard streams.
This commit is contained in:
parent
ff6051511f
commit
6776c2cdb9
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue