It calls either usage() which exits or it calls exit(send_command()).

OK?

Index: apm.c
===================================================================
RCS file: /cvs/src/usr.sbin/apm/apm.c,v
retrieving revision 1.37
diff -u -p -r1.37 apm.c
--- apm.c       23 Sep 2020 05:50:26 -0000      1.37
+++ apm.c       2 Apr 2021 15:59:56 -0000
@@ -50,7 +50,7 @@
 
 extern char *__progname;
 
-static int             do_zzz(int, enum apm_action);
+static __dead void     do_zzz(int, enum apm_action);
 static int             open_socket(const char *);
 static int             send_command(int, struct apm_command *,
                            struct apm_reply *);
@@ -91,7 +91,7 @@ send_command(int fd, struct apm_command 
        return (0);
 }
 
-static int
+static __dead void
 do_zzz(int fd, enum apm_action action)
 {
        struct apm_command command;
@@ -253,13 +253,11 @@ main(int argc, char *argv[])
        if (!strcmp(__progname, "zzz")) {
                if (fd < 0)
                        err(1, "cannot connect to apmd");
-               else
-                       return (do_zzz(fd, action));
+               do_zzz(fd, action);
        } else if (!strcmp(__progname, "ZZZ")) {
                if (fd < 0)
                        err(1, "cannot connect to apmd");
-               else
-                       return (do_zzz(fd, HIBERNATE));
+               do_zzz(fd, HIBERNATE);
        }
 
 

Reply via email to