[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#850717: procps: [kfreebsd] pkill fails, number_of_signals changed



Package: procps
Version: 2:3.3.12-3
Severity: important
Tags: upstream patch
X-Debbugs-Cc: debian-bsd@lists.debian.org
User: debian-bsd@lists.debian.org
Usertags: kfreebsd

Hello,

Jon's patch[0] unfortunately causes number_of_signals to differ
between Linux and other kernels not having SIGPWR.  pkill from the
Debian procps/2:3.3.12-3 package has this issue on kfreebsd arches:

$ pkill -2 foobar
WARNING: 30 signals -- adjust and recompile.

In proc/sig.c:

289 /* sanity check */
290 static int init_signal_list(void) __attribute__((constructor));
291 static int init_signal_list(void){
292   if(number_of_signals != 31){
293     fprintf(stderr, "WARNING: %d signals -- adjust and recompile.\n", number_of_signals);
294   }
295   return 0;
296 }

it may be counter-productive to maintain an expected number_of_signals
for each platform.  May I suggest to only do the sanity check on Linux?
(patch attached, tested on kfreebsd-amd64)

[0]: https://gitlab.com/procps-ng/procps/commit/8abd0c92ab7576280b2a601c12ff749ab41c117f

Many thanks,
Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org
From 7741344069d31d5e7f4206534ed1989ed1180e49 Mon Sep 17 00:00:00 2001
From: Steven Chamberlain <steven@pyro.eu.org>
Date: Mon, 9 Jan 2017 15:46:36 +0000
Subject: [PATCH] library: only check number_of_signals on Linux

number_of_signals is expected to differ across platforms.  Rather than
try to define the expected values on each architecture, only perform the
sanity check on Linux builds.
---
 proc/sig.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/proc/sig.c b/proc/sig.c
index 461db1d..33330a4 100644
--- a/proc/sig.c
+++ b/proc/sig.c
@@ -287,8 +287,10 @@ void unix_print_signals(void){
 /* sanity check */
 static int init_signal_list(void) __attribute__((constructor));
 static int init_signal_list(void){
+#ifdef __linux__
   if(number_of_signals != 31){
     fprintf(stderr, "WARNING: %d signals -- adjust and recompile.\n", number_of_signals);
   }
+#endif
   return 0;
 }
-- 
2.5.1

Attachment: signature.asc
Description: Digital signature


Reply to: