summaryrefslogtreecommitdiff
path: root/bin/mkdir
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-08-14 03:49:15 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-08-14 03:49:15 +0000
commitab9c338739d40440452067d4b4571b8f31cfeb2e (patch)
treed69a57ad962146780c5c5e57838dd5c996169803 /bin/mkdir
parentda13bd6b06c5ef36e407da488b18f9f60653a0eb (diff)
Get mode of last directory right when doing mkdir -p; NetBSD PR #2686
Diffstat (limited to 'bin/mkdir')
-rw-r--r--bin/mkdir/mkdir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c
index 726b1896907..85dc2d561f1 100644
--- a/bin/mkdir/mkdir.c
+++ b/bin/mkdir/mkdir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkdir.c,v 1.3 1996/08/02 12:40:58 deraadt Exp $ */
+/* $OpenBSD: mkdir.c,v 1.4 1996/08/14 03:49:14 tholo Exp $ */
/* $NetBSD: mkdir.c,v 1.14 1995/06/25 21:59:21 mycroft Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mkdir.c 8.2 (Berkeley) 1/25/94";
#else
-static char rcsid[] = "$OpenBSD: mkdir.c,v 1.3 1996/08/02 12:40:58 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: mkdir.c,v 1.4 1996/08/14 03:49:14 tholo Exp $";
#endif
#endif /* not lint */
@@ -149,7 +149,7 @@ mkpath(path, mode, dir_mode)
*slash = '\0';
if (stat(path, &sb)) {
- if (errno != ENOENT || mkdir(path, dir_mode)) {
+ if (errno != ENOENT || mkdir(path, done ? mode : dir_mode)) {
warn("%s", path);
return (-1);
}