diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2020-06-01 00:18:40 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2020-06-01 00:18:40 +0000 |
commit | 0264df40be306e5375fe1ae5ad2eda56f6405cae (patch) | |
tree | ce33036c2d3b36a27fbfe91cf7159c0cfca357ef /src | |
parent | fa5a8c2bd05826e25514587a069784f96ed76213 (diff) | |
download | s6-portable-utils-0264df40be306e5375fe1ae5ad2eda56f6405cae.tar.gz s6-portable-utils-0264df40be306e5375fe1ae5ad2eda56f6405cae.tar.xz s6-portable-utils-0264df40be306e5375fe1ae5ad2eda56f6405cae.zip |
Nothing to see here, just prepare for 2.2.2.4
Diffstat (limited to 'src')
-rw-r--r-- | src/skaembutils/s6-mkdir.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/skaembutils/s6-mkdir.c b/src/skaembutils/s6-mkdir.c index 352669a..4d1d7b9 100644 --- a/src/skaembutils/s6-mkdir.c +++ b/src/skaembutils/s6-mkdir.c @@ -10,6 +10,7 @@ #include <skalibs/strerr2.h> #define USAGE "s6-mkdir [ -p ] [ -v ] [ -m mode ] dir" +#define dieusage() strerr_dieusage(100, USAGE) static int doit (char const *s, unsigned int mode, int verbose, int ee) { @@ -54,6 +55,7 @@ int main (int argc, char const *const *argv) int parents = 0, verbose = 0 ; unsigned int mode = 0777 ; int e = 0 ; + int noumask = 0 ; PROG = "s6-mkdir" ; { subgetopt_t l = SUBGETOPT_ZERO ; @@ -65,13 +67,13 @@ int main (int argc, char const *const *argv) { case 'p': parents = 1 ; break ; case 'v': verbose = 1 ; break ; - case 'm': if (uint_oscan(l.arg, &mode)) break ; + case 'm': if (!uint_oscan(l.arg, &mode)) dieusage() ; noumask = 1 ; break ; default : strerr_dieusage(100, USAGE) ; } } argc -= l.ind ; argv += l.ind ; } - umask(0) ; + if (noumask) umask(0) ; for ( ; *argv ; argv++) e |= parents ? doparents(*argv, mode, verbose) : doit(*argv, mode, verbose, 1) ; |