]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/mailsplit.c
use xopen() to handle fatal open(2) failures
[thirdparty/git.git] / builtin / mailsplit.c
index 664400b8169b673f735e77f7dd86474f1665a3ae..7baef30569fce8e6b4a7353067bb4aba00561557 100644 (file)
@@ -75,9 +75,7 @@ static int split_one(FILE *mbox, const char *name, int allow_bare)
                fprintf(stderr, "corrupt mailbox\n");
                exit(1);
        }
-       fd = open(name, O_WRONLY | O_CREAT | O_EXCL, 0666);
-       if (fd < 0)
-               die_errno("cannot open output file '%s'", name);
+       fd = xopen(name, O_WRONLY | O_CREAT | O_EXCL, 0666);
        output = xfdopen(fd, "w");
 
        /* Copy it out, while searching for a line that begins with