summaryrefslogtreecommitdiff
path: root/sysutils/psmisc/patches/patch-ag
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/psmisc/patches/patch-ag')
-rw-r--r--sysutils/psmisc/patches/patch-ag82
1 files changed, 82 insertions, 0 deletions
diff --git a/sysutils/psmisc/patches/patch-ag b/sysutils/psmisc/patches/patch-ag
new file mode 100644
index 00000000000..3b2cb102afa
--- /dev/null
+++ b/sysutils/psmisc/patches/patch-ag
@@ -0,0 +1,82 @@
+$NetBSD: patch-ag,v 1.1 2001/04/24 16:59:35 jlam Exp $
+
+--- src/signals.c.orig Wed Dec 13 18:43:15 2000
++++ src/signals.c
+@@ -7,9 +7,17 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <ctype.h>
++#include <sys/param.h>
+ #include "signals.h"
+
++#if (defined(BSD) && BSD >= 199306)
++#define HAVE_SYS_SIGNAME
++#endif
+
++
++#ifdef HAVE_SYS_SIGNAME
++#include <signal.h>
++#else
+ typedef struct
+ {
+ int number;
+@@ -22,11 +30,26 @@
+ #include "signames.h"
+ {0, NULL}
+ };
++#endif
+
+
+ void
+ list_signals (void)
+ {
++#ifdef HAVE_SYS_SIGNAME
++ int i, col;
++
++ col = 0;
++ for (i = 1; i < NSIG; i++) {
++ if (col+strlen(sys_signame[i])+1 > 80) {
++ putchar('\n');
++ col = 0;
++ }
++ printf("%s%s",col ? " " : "",sys_signame[i]);
++ col += strlen(sys_signame[i])+1;
++ }
++ putchar('\n');
++#else
+ SIGNAME *walk;
+ int col;
+
+@@ -42,12 +65,26 @@
+ col += strlen (walk->name) + 1;
+ }
+ putchar ('\n');
++#endif
+ }
+
+
+ int
+ get_signal (char *name, const char *cmd)
+ {
++#ifdef HAVE_SYS_SIGNAME
++ int i;
++ if (isdigit(*name))
++ return atoi(name);
++ for (i = 1; i < NSIG; i++) {
++ if (!strcmp(sys_signame[i],name))
++ break;
++ }
++ if (i < NSIG)
++ return i;
++ fprintf(stderr,"%s: unknown signal; %s -l lists signals.\n",name,cmd);
++ exit(1);
++#else
+ SIGNAME *walk;
+
+ if (isdigit (*name))
+@@ -59,4 +96,5 @@
+ return walk->number;
+ fprintf (stderr, "%s: unknown signal; %s -l lists signals.\n", name, cmd);
+ exit (1);
++#endif
+ }