[hackers] [sbase] kill: accept $? values || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Tue, 21 Jun 2011 06:05:53 +0200 (CEST)

changeset: 89:af0e98cea3c6
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Tue Jun 21 04:56:16 2011 +0100
files: kill.c
description:
kill: accept $? values

diff -r 0c27b64dcc4f -r af0e98cea3c6 kill.c
--- a/kill.c Mon Jun 20 18:37:39 2011 +0100
+++ b/kill.c Tue Jun 21 04:56:16 2011 +0100
@@ -5,6 +5,7 @@
 #include <stdlib.h>
 #include <strings.h>
 #include <unistd.h>
+#include <sys/wait.h>
 #include "util.h"
 
 #define LEN(x) (sizeof (x) / sizeof *(x))
@@ -54,6 +55,8 @@
                                 " %s -l [signum]\n", argv[0], argv[0]);
 
                 sig = (optind == argc) ? 0 : estrtol(argv[optind], 0);
+ if(sig > 128)
+ sig = WTERMSIG(sig);
                 for(i = 0; i < LEN(sigs); i++)
                         if(sigs[i].sig == sig || sig == 0)
                                 putword(sigs[i].name);
Received on Tue Jun 21 2011 - 06:05:53 CEST

This archive was generated by hypermail 2.2.0 : Tue Jun 21 2011 - 06:12:05 CEST