Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 33786 invoked from network); 23 Aug 2006 15:19:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Aug 2006 15:19:46 -0000 Received: (qmail 55437 invoked by uid 500); 23 Aug 2006 15:19:46 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 55380 invoked by uid 500); 23 Aug 2006 15:19:45 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 55369 invoked by uid 99); 23 Aug 2006 15:19:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Aug 2006 08:19:45 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [212.82.213.172] (HELO exkiv.kyiv.vdiweb.com) (212.82.213.172) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Aug 2006 08:19:44 -0700 Received: from [10.11.37.198] ([10.11.37.198]) by exkiv.kyiv.vdiweb.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 23 Aug 2006 18:19:40 +0300 Message-ID: <44EC7211.20201@kyiv.vdiweb.com> Date: Wed, 23 Aug 2006 18:19:45 +0300 From: Farid Zaripov User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: RE: [PATCH] exec utility patch Content-Type: multipart/mixed; boundary="------------000506040402080604070704" X-OriginalArrivalTime: 23 Aug 2006 15:19:40.0507 (UTC) FILETIME=[8DB7EAB0:01C6C6C7] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --------------000506040402080604070704 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit > -----Original Message----- > From: Andrew Black [mailto:ablack@roguewave.com] > Sent: Wednesday, August 23, 2006 12:02 AM > To: stdcxx-dev@incubator.apache.org > Subject: Re: [PATCH] exec utility patch > > The first observation I have is that there is a certain > amount of 'noise' in the patch from spelling corrections in > comments. These spelling fixes should probably be submitted > as a separate cleanup patch. That is VisualAssist plugin for VisualStudio underlines with red color the incorrect words and I corrected that words to not see them. I have disabled spelling feature for now. > > The second observation I have is about the use of get_signame > on the SIGSEGV constant. It would be more efficient to use > 'puts (" SEGV\n") > ;' rather than calling printf on a function that returns > what is essentially a constant. An additional benefit is > that you wouldn't need to include signal.h. Agreed. Corrected patch is attached. Farid. --------------000506040402080604070704 Content-Type: text/plain; name="utils.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="utils.patch" Index: exec.cpp =================================================================== --- exec.cpp (revision 433977) +++ exec.cpp (working copy) @@ -930,6 +930,11 @@ merged = merge_argv (argv); + /* set appropriate error mode (the child process inherits this + error mode) to disable displaying the critical-error-handler + and general-protection-fault message boxes */ + UINT old_mode = SetErrorMode (SEM_FAILCRITICALERRORS + | SEM_NOGPFAULTERRORBOX); /* Create the child process */ if (0 == CreateProcess (argv [0], merged, 0, 0, 1, CREATE_NEW_PROCESS_GROUP, 0, 0, &context, &child)) { @@ -938,6 +943,9 @@ status.error = warn_last_error ("Creating child process");; } + /* restore the previous error mode */ + SetErrorMode (old_mode); + /* Clean up handles */ if (context.hStdInput) if (0 == CloseHandle (context.hStdInput)) Index: runall.cpp =================================================================== --- runall.cpp (revision 433977) +++ runall.cpp (working copy) @@ -35,6 +35,8 @@ #include #if !defined (_WIN32) && !defined (_WIN64) # include /* for WIFEXITED(), ... */ +#else +# include /* for STATUS_ACCESS_VIOLATION */ #endif #include "cmdopt.h" @@ -350,6 +352,8 @@ puts (" I/O"); else if (result->error) puts ("KILLED"); + else if (STATUS_ACCESS_VIOLATION == result->status) + puts (" SEGV"); else printf ("%6d\n", result->status); #endif /* _WIN{32,64} */ --------------000506040402080604070704--