From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gw.goop.org ([206.170.148.147]) by hawkwind.utcs.toronto.edu with SMTP id <25429>; Wed, 31 Jul 2002 15:26:18 -0500 Received: by gw.goop.org (Postfix, from userid 525) id A825178430; Tue, 30 Jul 2002 23:15:47 -0700 (PDT) Received: from ixodes.goop.org (ixodes.goop.org [192.168.0.5]) by gw.goop.org (Postfix) with ESMTP id 726407842F for ; Tue, 30 Jul 2002 23:15:47 -0700 (PDT) Subject: minor nits picked up by valgrind From: Jeremy Fitzhardinge To: rc list Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: Wed, 31 Jul 2002 02:15:47 -0500 Message-Id: <1028096147.2444.57.camel@ixodes.goop.org> Mime-Version: 1.0 Since valgrind[1] came out, I've been applying it to everything I can think of. rc was pretty clean, with one actual (but minor) problem and one non-problem. The actual problem is that it doesn't clear out the sa_mask when calling sigaction, which presumably means that there's a random set of signals masked when calling the signal handler. I'm assuming this isn't a big problem. Maybe it should be sigfillset instead? The non-problem is that it tries to call sigaction on SIGKILL and SIGSTOP. This is ignored by the kernel, but it makes valgrind complain. Here's a patch for both of these: --- rc-1.7/signal.c Thu Nov 1 03:29:10 2001 +++ rc-1.7.jsgf/signal.c Tue Jul 30 23:08:39 2002 @@ -14,6 +14,7 @@ new.sa_handler = handler; new.sa_flags = SA_INTERRUPT; + sigemptyset(&new.sa_mask); sigaction(signum, &new, &old); return old.sa_handler; } @@ -96,6 +97,8 @@ #endif for (i = 1; i < NUMOFSIGNALS; i++) { + if (i == SIGSTOP || i == SIGKILL) + continue; h = sys_signal(i, SIG_IGN); if (h != SIG_IGN && h != SIG_ERR) sys_signal(i, h); J 1: http://developer.kde.org/~sewardj/