Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/autofs sprinkle __dead, use EXIT_{SUCCESS, FAILURE}



details:   https://anonhg.NetBSD.org/src/rev/b98c8d716669
branches:  trunk
changeset: 828955:b98c8d716669
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jan 11 13:44:26 2018 +0000

description:
sprinkle __dead, use EXIT_{SUCCESS,FAILURE}

diffstat:

 usr.sbin/autofs/automountd.c |  24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diffs (88 lines):

diff -r f7acc750da6f -r b98c8d716669 usr.sbin/autofs/automountd.c
--- a/usr.sbin/autofs/automountd.c      Thu Jan 11 13:35:15 2018 +0000
+++ b/usr.sbin/autofs/automountd.c      Thu Jan 11 13:44:26 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: automountd.c,v 1.1 2018/01/09 03:31:15 christos Exp $  */
+/*     $NetBSD: automountd.c,v 1.2 2018/01/11 13:44:26 christos Exp $  */
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  *
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: automountd.c,v 1.1 2018/01/09 03:31:15 christos Exp $");
+__RCSID("$NetBSD: automountd.c,v 1.2 2018/01/11 13:44:26 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/ioctl.h>
@@ -163,7 +163,7 @@
        done(EIO, true);
 }
 
-static void
+__dead static void
 handle_request(const struct autofs_daemon_request *adr, char *cmdline_options,
     bool incomplete_hierarchy)
 {
@@ -262,7 +262,7 @@
                        /*
                         * Exit without calling exit_callback().
                         */
-                       quick_exit(0);
+                       quick_exit(EXIT_SUCCESS);
                }
 
                /*
@@ -288,7 +288,7 @@
                /*
                 * Exit without calling exit_callback().
                 */
-               quick_exit(0);
+               quick_exit(EXIT_SUCCESS);
        }
 
        log_debugx("found node defined at %s:%d; it is a mountpoint",
@@ -362,7 +362,7 @@
        /*
         * Exit without calling exit_callback().
         */
-       quick_exit(0);
+       quick_exit(EXIT_SUCCESS);
 }
 
 static void
@@ -424,13 +424,13 @@
        return num;
 }
 
-static void
+__dead static void
 usage_automountd(void)
 {
 
-       fprintf(stderr, "usage: automountd [-D name=value][-m maxproc]"
-           "[-o opts][-Tidv]\n");
-       exit(1);
+       fprintf(stderr, "Usage: %s [-D name=value][-m maxproc]"
+           "[-o opts][-Tidv]\n", getprogname());
+       exit(EXIT_FAILURE);
 }
 
 static int
@@ -531,7 +531,7 @@
                if (daemon(0, 0) == -1) {
                        log_warn("cannot daemonize");
                        pidfile_clean();
-                       exit(1);
+                       exit(EXIT_FAILURE);
                }
        } else {
                lesser_daemon();
@@ -597,5 +597,5 @@
 
        pidfile_clean();
 
-       return 0;
+       return EXIT_SUCCESS;
 }



Home | Main Index | Thread Index | Old Index