print_signames_and_exit -> print_signames (because of "ash calls kill_main")
authorDenis Vlasenko <vda.linux@googlemail.com>
Sun, 30 Sep 2007 16:32:01 +0000 (16:32 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sun, 30 Sep 2007 16:32:01 +0000 (16:32 -0000)
include/libbb.h
libbb/u_signal_names.c
procps/kill.c
procps/pgrep.c

index 34b978452e6e4b298170a778294ce1557275124c..e3f9c4957a921252099812ee5fc18171c6cbf324 100644 (file)
@@ -787,7 +787,7 @@ int bb_make_directory(char *path, long mode, int flags);
 
 int get_signum(const char *name);
 const char *get_signame(int number);
-void print_signames_and_exit(void) ATTRIBUTE_NORETURN;
+void print_signames(void);
 
 char *bb_simplify_path(const char *path);
 
index 5a6f592aa459de1fa116eeb7658bcc84229724d7..ed3bb5c5bdb1a6275dd369b51ad0393e4113342d 100644 (file)
@@ -163,7 +163,7 @@ const char *get_signame(int number)
 
 // Print the whole signal list
 
-void print_signames_and_exit(void)
+void print_signames(void)
 {
        int signo;
 
@@ -172,5 +172,4 @@ void print_signames_and_exit(void)
                if (name[0])
                        puts(name);
        }
-       exit(EXIT_SUCCESS);
 }
index 961f8cb14bcce01f3c9f27c5e3c5d23208fd646e..323ee7bf4e6bd531bc2df47d62e73183194c8cee 100644 (file)
@@ -58,7 +58,8 @@ int kill_main(int argc, char **argv)
        if (arg[1] == 'l' && arg[2] == '\0') {
                if (argc == 1) {
                        /* Print the whole signal list */
-                       print_signames_and_exit();
+                       print_signames();
+                       return 0;
                }
                /* -l <sig list> */
                while ((arg = *++argv)) {
index 3bf087f28db3a4dcd2e4e8be58c287d7badaa6c4..2bedabf72a409111887e61587bbdc012a02a343b 100644 (file)
@@ -87,8 +87,10 @@ int pgrep_main(int argc, char **argv)
                scan_mask |= PSSCAN_ARGVN;
 
        if (pkill) {
-               if (OPT_LIST) /* -l: print the whole signal list */
-                       print_signames_and_exit();
+               if (OPT_LIST) { /* -l: print the whole signal list */
+                       print_signames();
+                       return 0;
+               }
                if (first_arg && first_arg[0] == '-') {
                        signo = get_signum(&first_arg[1]);
                        if (signo < 0) /* || signo > MAX_SIGNUM ? */