From owner-svn-src-all@FreeBSD.ORG Wed Jan 12 14:38:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 970DC1065693; Wed, 12 Jan 2011 14:38:17 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8629E8FC0C; Wed, 12 Jan 2011 14:38:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0CEcHIm092157; Wed, 12 Jan 2011 14:38:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0CEcHWW092155; Wed, 12 Jan 2011 14:38:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101121438.p0CEcHWW092155@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 12 Jan 2011 14:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217308 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2011 14:38:17 -0000 Author: pjd Date: Wed Jan 12 14:38:17 2011 New Revision: 217308 URL: http://svn.freebsd.org/changeset/base/217308 Log: Add a note that when custom signal handler is installed for a signal, signal action is restored to default in child after fork(2). In this case there is no need to do anything with dummy SIGCHLD handler, because after fork(2) it will be automatically reverted to SIG_IGN. Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com MFC after: 3 days Modified: head/sbin/hastd/hooks.c Modified: head/sbin/hastd/hooks.c ============================================================================== --- head/sbin/hastd/hooks.c Wed Jan 12 14:35:29 2011 (r217307) +++ head/sbin/hastd/hooks.c Wed Jan 12 14:38:17 2011 (r217308) @@ -372,6 +372,11 @@ hook_execv(const char *path, va_list ap) descriptors(); PJDLOG_VERIFY(sigemptyset(&mask) == 0); PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); + /* + * Dummy handler set for SIGCHLD in the parent should be + * changed after fork(2) automatically to the default SIG_IGN, + * so there is no need to do anything with it. + */ execv(path, args); pjdlog_errno(LOG_ERR, "Unable to execute %s", path); exit(EX_SOFTWARE);