aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/procps.c11
-rw-r--r--libbb/u_signal_names.c15
2 files changed, 25 insertions, 1 deletions
diff --git a/libbb/procps.c b/libbb/procps.c
index e62e5a1f1..476e1f34d 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -375,13 +375,22 @@ procps_status_t *procps_scan(procps_status_t* sp, int flags)
}
}
#else
- if (flags & PSSCAN_ARGV0) {
+ if (flags & *PSSCAN_ARGV0|PSSCAN_ARGVN)) {
free(sp->argv0);
sp->argv0 = NULL;
strcpy(filename_tail, "/cmdline");
n = read_to_buf(filename, buf);
if (n <= 0)
break;
+#if ENABLE_PGREP || ENABLE_PKILL
+ if (flags & PSSCAN_ARGVN) {
+ do {
+ n--;
+ if (buf[n] == '\0')
+ buf[n] = ' ';
+ } while (n);
+ }
+#endif
sp->argv0 = xstrdup(buf);
}
#endif
diff --git a/libbb/u_signal_names.c b/libbb/u_signal_names.c
index f8eaea76d..5a6f592aa 100644
--- a/libbb/u_signal_names.c
+++ b/libbb/u_signal_names.c
@@ -159,3 +159,18 @@ const char *get_signame(int number)
return itoa(number);
}
+
+
+// Print the whole signal list
+
+void print_signames_and_exit(void)
+{
+ int signo;
+
+ for (signo = 1; signo < ARRAY_SIZE(signals); signo++) {
+ const char *name = signals[signo];
+ if (name[0])
+ puts(name);
+ }
+ exit(EXIT_SUCCESS);
+}