From owner-freebsd-questions Wed Jul 14 4:53:10 1999 Delivered-To: freebsd-questions@freebsd.org Received: from ivory.lm.com (ivory.telerama.com [205.201.1.20]) by hub.freebsd.org (Postfix) with ESMTP id 29E451506D for ; Wed, 14 Jul 1999 04:53:05 -0700 (PDT) (envelope-from evs@telerama.com) Received: from mvehpc (d18-22.dyn.telerama.com [205.201.4.22]) by ivory.lm.com (8.8.5/8.6.12) with SMTP id HAA05970 for ; Wed, 14 Jul 1999 07:52:54 -0400 (EDT) Message-ID: <005f01becdef$71bc5b80$6f27abcd@mvehpc.evs.slip.lm.com> Reply-To: "Mikhail V. Evstiounin" From: "Mikhail V. Evstiounin" To: Subject: Re: result of pclose Date: Wed, 14 Jul 1999 07:52:55 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -----Original Message----- From: Thomas David Rivers To: mi@kot.ne.mediaone.net ; questions@FreeBSD.ORG Date: Wednesday, July 14, 1999 7:08 AM Subject: Re: result of pclose >> According to pclose(3), its result must be the exit code of the process. >> Is this a bug, or do I misunderstand the manual? Thanks! >> >> -mi >> > > That is the exit code of the process. > > The exit code returns is in a format called the `status area', > and is exactly the same as that returned by the wait(2) > system call. > > The wait(2) man page describes the macros you need to use to > get the return code of the process. > > What you want to do is something like: > > rc = WEXITSTATUS(pclose(pipe)); Actually, you want check both parts - what process returns and how it ends: normal, been killed or crashes. > > - Dave Rivers - > > > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message