diff options
author | 2005-06-20 07:14:06 +0000 | |
---|---|---|
committer | 2005-06-20 07:14:06 +0000 | |
commit | 6fd3743fe6e9bb2da797aa227603f70552d86aae (patch) | |
tree | a228dcb2357acdd115194a3c6238270338964485 /usr.bin/patch/mkpath.c | |
parent | K&R -> ANSI (diff) | |
download | wireguard-openbsd-6fd3743fe6e9bb2da797aa227603f70552d86aae.tar.xz wireguard-openbsd-6fd3743fe6e9bb2da797aa227603f70552d86aae.zip |
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); |