summaryrefslogtreecommitdiff
path: root/usr/src/lib/libcmd/common/mkdir.c
diff options
context:
space:
mode:
authorRoger A. Faulkner <Roger.Faulkner@Oracle.COM>2010-04-03 09:48:44 -0700
committerRoger A. Faulkner <Roger.Faulkner@Oracle.COM>2010-04-03 09:48:44 -0700
commit3e14f97f673e8a630f076077de35afdd43dc1587 (patch)
tree9828b6b676f58d7b27dd28e00202d3f3461a5cd8 /usr/src/lib/libcmd/common/mkdir.c
parent4f60987df4dcaa54a88b596f861fbf4f3382c65e (diff)
downloadillumos-joyent-3e14f97f673e8a630f076077de35afdd43dc1587.tar.gz
6939349 RFE: Update ksh93 to ast-ksh.2010-03-09
6877392 ksh93 regresses 'uniq -c' performance 6887363 Korn shell 93 sometimes mishandles return value of its child process 6900314 (while true ; do true|true ; done) hang in ioctl() with SIGTTOU 6904557 wc no longer counts number of bytes correctly 6904575 cut -d with multibyte character no longer works 6904597 paste -d no longer works with multibyte characters 6904780 /usr/bin/cksum changed output in snv_128 6904870 uniq -s does not skip multibyte characters correctly 6904878 join -t no longer works with multibyte char separator 6907460 EXIT trap handlers are sometimes executed twice 6909579 libast getopt solaris compatibility broken 6920072 ksh93 tail -f, with unconditional .25s sleep and line parsing, about 37x slower than cat 6932124 mktemp in ksh93 is broken Contributed by Olga Kryzhanovska <olga.kryzhanovska@gmail.com>
Diffstat (limited to 'usr/src/lib/libcmd/common/mkdir.c')
-rw-r--r--usr/src/lib/libcmd/common/mkdir.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/usr/src/lib/libcmd/common/mkdir.c b/usr/src/lib/libcmd/common/mkdir.c
index 5ccce98221..491d990f64 100644
--- a/usr/src/lib/libcmd/common/mkdir.c
+++ b/usr/src/lib/libcmd/common/mkdir.c
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1992-2009 AT&T Intellectual Property *
+* Copyright (c) 1992-2010 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -27,7 +27,7 @@
*/
static const char usage[] =
-"[-?\n@(#)$Id: mkdir (AT&T Research) 2007-04-25 $\n]"
+"[-?\n@(#)$Id: mkdir (AT&T Research) 2009-12-03 $\n]"
USAGE_LICENSE
"[+NAME?mkdir - make directories]"
"[+DESCRIPTION?\bmkdir\b creates one or more directories. By "
@@ -43,6 +43,8 @@ USAGE_LICENSE
"dir\v where the \b-m\b mode option represents that option supplied to "
"the original invocation of \bmkdir\b, if any. Each dir operand that "
"names an existing directory shall be ignored without error.]"
+"[v:verbose?Print a message on the standard error for each created "
+ "directory.]"
"\n"
"\ndirectory ...\n"
"\n"
@@ -68,6 +70,7 @@ b_mkdir(int argc, char** argv, void* context)
register mode_t mask = 0;
register int mflag = 0;
register int pflag = 0;
+ register int vflag = 0;
char* name;
mode_t dmode;
struct stat st;
@@ -79,15 +82,18 @@ b_mkdir(int argc, char** argv, void* context)
{
case 0:
break;
- case 'p':
- pflag = 1;
- continue;
case 'm':
mflag = 1;
mode = strperm(arg = opt_info.arg, &opt_info.arg, mode);
if (*opt_info.arg)
error(ERROR_exit(0), "%s: invalid mode", arg);
continue;
+ case 'p':
+ pflag = 1;
+ continue;
+ case 'v':
+ vflag = 1;
+ continue;
case ':':
error(2, "%s", opt_info.arg);
continue;
@@ -149,6 +155,8 @@ b_mkdir(int argc, char** argv, void* context)
error(ERROR_system(0), "%s:", name);
break;
}
+ if (vflag)
+ error(0, "%s: directory created", name);
if (!(*arg = n) && (mode & (S_ISVTX|S_ISUID|S_ISGID)))
{
if (stat(name, &st))
@@ -164,6 +172,8 @@ b_mkdir(int argc, char** argv, void* context)
}
}
}
+ else if (vflag)
+ error(0, "%s: directory created", arg);
}
if (mask)
umask(mask);