From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] waitpid should not crash on error Date: Mon, 17 Oct 2011 13:00:24 -0400 Message-ID: <87zkgzpn87.fsf@yeeloong.netris.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1318870867 22099 80.91.229.12 (17 Oct 2011 17:01:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2011 17:01:07 +0000 (UTC) Cc: guile-devel To: Nala Ginrut Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Oct 17 19:01:03 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RFqYg-0002tu-TH for guile-devel@m.gmane.org; Mon, 17 Oct 2011 19:01:03 +0200 Original-Received: from localhost ([::1]:43062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFqYg-00006f-DR for guile-devel@m.gmane.org; Mon, 17 Oct 2011 13:01:02 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:37407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFqYd-00006Z-K5 for guile-devel@gnu.org; Mon, 17 Oct 2011 13:01:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFqYY-0002Up-0b for guile-devel@gnu.org; Mon, 17 Oct 2011 13:00:59 -0400 Original-Received: from world.peace.net ([96.39.62.75]:52760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFqYX-0002TI-Tf for guile-devel@gnu.org; Mon, 17 Oct 2011 13:00:53 -0400 Original-Received: from 209-6-55-18.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.55.18] helo=yeeloong.netris.org) by world.peace.net with esmtpa (Exim 4.69) (envelope-from ) id 1RFqYH-0008Vd-Gc; Mon, 17 Oct 2011 13:00:38 -0400 Original-Received: from mhw by yeeloong.netris.org with local (Exim 4.72) (envelope-from ) id 1RFqY5-0000IR-9o; Mon, 17 Oct 2011 13:00:25 -0400 In-Reply-To: (Nala Ginrut's message of "Sun, 16 Oct 2011 11:57:38 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12841 Archived-At: Nala Ginrut writes: > I realized that "waitpid" in Guile will cause my program crash while > "waitpid"=C2=A0actually=C2=A0returned -1. I believe it's=C2=A0unnecessary= . I think > the better way is we deal with it by ourselves if "waitpid in POSIX" > returned -1. The SCM_SYSERROR bother me a lot. I hope my program > get=C2=A0robustness other than crash.=C2=A0 The proper way to deal with this is to catch the system error, e.g.: (catch 'system-error (lambda () (waitpid the-pid)) (lambda (key . args) 'waitpid-failed)) Best, Mark