diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2005-06-20 07:14:07 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2005-06-20 07:14:07 +0000 |
commit | 98879a571dcaaeee3548acace8c6453f7765802e (patch) | |
tree | b8687d42f6c42dcc8c967d0cc6fa0d2af2ae1edf /usr.bin/patch/mkpath.c | |
parent | 3957ca90a5622f6255ef6db322a41f7ffdfe46f4 (diff) |
umask juggling not needed; with Lionel Fourquaux.
ok millert@ espie@
Diffstat (limited to 'usr.bin/patch/mkpath.c')
-rw-r--r-- | usr.bin/patch/mkpath.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.bin/patch/mkpath.c b/usr.bin/patch/mkpath.c index a983768adc3..1e600a8a8ba 100644 --- a/usr.bin/patch/mkpath.c +++ b/usr.bin/patch/mkpath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkpath.c,v 1.1 2005/05/16 15:22:46 espie Exp $ */ +/* $OpenBSD: mkpath.c,v 1.2 2005/06/20 07:14:06 otto Exp $ */ /* * Copyright (c) 1983, 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -38,11 +38,9 @@ * mkpath -- create directories. * path - path - * mode - file mode of terminal directory - * dir_mode - file mode of intermediate directories */ int -mkpath(char *path, mode_t mode, mode_t dir_mode) +mkpath(char *path) { struct stat sb; char *slash; @@ -58,8 +56,7 @@ mkpath(char *path, mode_t mode, mode_t dir_mode) *slash = '\0'; if (stat(path, &sb)) { - if (errno != ENOENT || - (mkdir(path, done ? mode : dir_mode) && + if (errno != ENOENT || (mkdir(path, 0777) && errno != EEXIST)) { warn("%s", path); return (-1); |