Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/mkdir Cosmetic changes.



details:   https://anonhg.NetBSD.org/src/rev/96d2d4d22e5c
branches:  trunk
changeset: 522443:96d2d4d22e5c
user:      enami <enami%NetBSD.org@localhost>
date:      Tue Feb 19 06:30:12 2002 +0000

description:
Cosmetic changes.

diffstat:

 bin/mkdir/mkdir.c |  22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diffs (85 lines):

diff -r 72d9b055e0fd -r 96d2d4d22e5c bin/mkdir/mkdir.c
--- a/bin/mkdir/mkdir.c Tue Feb 19 06:16:35 2002 +0000
+++ b/bin/mkdir/mkdir.c Tue Feb 19 06:30:12 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkdir.c,v 1.25 2001/09/16 22:07:14 wiz Exp $ */
+/* $NetBSD: mkdir.c,v 1.26 2002/02/19 06:30:12 enami Exp $ */
 
 /*
  * Copyright (c) 1983, 1992, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)mkdir.c    8.2 (Berkeley) 1/25/94";
 #else
-__RCSID("$NetBSD: mkdir.c,v 1.25 2001/09/16 22:07:14 wiz Exp $");
+__RCSID("$NetBSD: mkdir.c,v 1.26 2002/02/19 06:30:12 enami Exp $");
 #endif
 #endif /* not lint */
 
@@ -83,7 +83,7 @@
 
        pflag = 0;
        while ((ch = getopt(argc, argv, "m:p")) != -1)
-               switch(ch) {
+               switch (ch) {
                case 'p':
                        pflag = 1;
                        break;
@@ -102,7 +102,7 @@
 
        if (*argv == NULL)
                usage();
-       
+
        for (exitval = EXIT_SUCCESS; *argv != NULL; ++argv) {
                char *slash;
 
@@ -138,7 +138,7 @@
 }
 
 /*
- * mkpath -- create directories.  
+ * mkpath -- create directories.
  *     path     - path
  *     mode     - file mode of terminal directory
  *     dir_mode - file mode of intermediate directories
@@ -161,8 +161,8 @@
                *slash = '\0';
 
                if (stat(path, &sb)) {
-                       if (errno != ENOENT
-                           || mkdir(path, done ? mode : dir_mode)) {
+                       if (errno != ENOENT ||
+                           mkdir(path, done ? mode : dir_mode)) {
                                warn("%s", path);
                                return (-1);
                        }
@@ -171,7 +171,7 @@
                         * file permission bits, so if you try to set a mode
                         * including the sticky, setuid, setgid bits you lose
                         * them. So chmod().
-                         */
+                        */
                        if (done && (mode & ~(S_IRWXU|S_IRWXG|S_IRWXU)) != 0 &&
                            chmod(path, mode) == -1) {
                                warn("%s", path);
@@ -181,7 +181,7 @@
                        warnx("%s: %s", path, strerror(ENOTDIR));
                        return (-1);
                }
-                   
+
                *slash = '/';
        }
 
@@ -191,7 +191,9 @@
 void
 usage(void)
 {
-       (void)fprintf(stderr, "usage: %s [-p] [-m mode] dirname ...\n", getprogname());
+
+       (void)fprintf(stderr, "usage: %s [-p] [-m mode] dirname ...\n",
+           getprogname());
        exit(EXIT_FAILURE);
        /* NOTREACHED */
 }



Home | Main Index | Thread Index | Old Index