From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 10 10:24:10 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D765016A419 for ; Sun, 10 Feb 2008 10:24:10 +0000 (UTC) (envelope-from cihan@enderunix.org) Received: from istanbul.enderunix.org (freefall.marmara.edu.tr [193.140.143.23]) by mx1.freebsd.org (Postfix) with ESMTP id EA64B13C461 for ; Sun, 10 Feb 2008 10:24:09 +0000 (UTC) (envelope-from cihan@enderunix.org) Received: (qmail 42184 invoked by uid 1040); 10 Feb 2008 10:24:14 -0000 Received: from unknown (HELO localhost) (cihan@85.105.200.118) by 0 with ESMTPA; 10 Feb 2008 10:24:13 -0000 Date: Sun, 10 Feb 2008 12:23:54 +0200 From: =?utf-8?B?Q2loYW4gS8O2bWXDp2/En2x1?= X-Mailer: The Bat! (v3.99.29) UNREG X-Priority: 3 (Normal) Message-ID: <1623050662.20080210122354@enderunix.org> To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-Antivirus: avast! (VPS 080209-0, 09.02.2008), Outbound message X-Antivirus-Status: Clean X-SMTP-Filter: SurGATE SMTP Filter Engine Release 1.0.1 http://www.endersys.com X-SurGATE-Result: Clean (Content eval: -4.40 points) Subject: abort? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Feb 2008 10:24:10 -0000 Hello list I cant understand why kill function is called two times to send sigabort signal. One signal to send is enough, isn't it? Thanks void abort(void) /* POSIX-style abort() function */ { sigset_t mask; struct sigaction action; /* * Caller can't ignore SIGABRT, if so reset to default. */ sigaction(SIGABRT, NULL, &action); if (action.sa_handler =3D=3D SIG_IGN) { action.sa_handler =3D SIG_DFL; sigaction(SIGABRT, &action, NULL); } if (action.sa_handler =3D=3D SIG_DFL) fflush(NULL); /* flush all open stdio streams */ /* * Caller can't block SIGABRT; make sure it's unblocked. */ sigfillset(&mask); sigdelset(&mask, SIGABRT); /* mask has only SIGABRT turned off */ sigprocmask(SIG_SETMASK, &mask, NULL); kill(getpid(), SIGABRT); /* send the signal */ /* * If we're here, process caught SIGABRT and returned. */ fflush(NULL); /* flush all open stdio streams */ action.sa_handler =3D SIG_DFL; sigaction(SIGABRT, &action, NULL); /* reset to default */ sigprocmask(SIG_SETMASK, &mask, NULL); /* just in case ... */ kill(getpid(), SIGABRT); /* and one more time */ exit(1); /* this should never be executed ... */ } =20 --=20 Cihan K=F6me=E7o=F0lu, EnderUNIX SDT mailto:cihan@enderunix.org