]> git.ipfire.org Git - thirdparty/git.git/blobdiff - run-command.c
use xopen() to handle fatal open(2) failures
[thirdparty/git.git] / run-command.c
index f72e72cce73f1a1decbdd99b098f050f37bea41f..2961f7e55efdc1dc7b675fa8ff2da3e5b35d5442 100644 (file)
@@ -761,9 +761,7 @@ fail_pipe:
                notify_pipe[0] = notify_pipe[1] = -1;
 
        if (cmd->no_stdin || cmd->no_stdout || cmd->no_stderr) {
-               null_fd = open("/dev/null", O_RDWR | O_CLOEXEC);
-               if (null_fd < 0)
-                       die_errno(_("open /dev/null failed"));
+               null_fd = xopen("/dev/null", O_RDWR | O_CLOEXEC);
                set_cloexec(null_fd);
        }