From stdcxx-dev-return-1907-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Tue Aug 08 19:10:50 2006 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 83568 invoked from network); 8 Aug 2006 19:10:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Aug 2006 19:10:50 -0000 Received: (qmail 79473 invoked by uid 500); 8 Aug 2006 19:10:49 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 79430 invoked by uid 500); 8 Aug 2006 19:10:49 -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 79374 invoked by uid 99); 8 Aug 2006 19:10:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 12:10:48 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [208.30.140.160] (HELO moroha.quovadx.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 12:10:48 -0700 Received: from [10.70.3.48] ([10.70.3.48]) by moroha.quovadx.com (8.13.6/8.13.4) with ESMTP id k78J9cYx006402 for ; Tue, 8 Aug 2006 19:09:39 GMT Message-ID: <44D8E1A1.2020106@roguewave.com> Date: Tue, 08 Aug 2006 13:10:25 -0600 From: Andrew Black User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060720 SeaMonkey/1.0.3 MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: [patch] Windows port prep for exec utility Content-Type: multipart/mixed; boundary="------------030707030105040003050003" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --------------030707030105040003050003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Greetings all Attached is a cleanup patch that contains non-porting related changes resulting from the windows port I've been working on. --Andrew Black Log: 2006-08-07 Andrew Black * cmdopt.cpp (eval_options): use raise (signal) rather than kill(getpid (), signal) * runall.cpp (merge_argv): Add missing terminator to generated array for bare executables * cmdopt.cpp, output.cpp, runall.cpp: remove unneeded #includes --------------030707030105040003050003 Content-Type: text/x-patch; name="winprep.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="winprep.diff" Index: cmdopt.cpp =================================================================== --- cmdopt.cpp (revision 429667) +++ cmdopt.cpp (working copy) @@ -31,11 +31,10 @@ #include #include /* for isspace */ #include /* for errno */ -#include /* for kill, SIG_IGN */ +#include /* for raise, signal, SIG_IGN */ #include /* for *printf, fputs */ #include /* for exit */ #include /* for str* */ -#include /* for getpid */ #include "exec.h" #include "util.h" @@ -316,10 +315,9 @@ if (optarg && *optarg) { const long signo = get_signo (optarg); if (0 <= signo) { - if (0 > kill (getpid (), signo)) - terminate (1, "kill(%d, %s) failed: %s\n", - getpid (), get_signame (signo), - strerror (errno)); + if (0 > raise (signo)) + terminate (1, "raise(%s) failed: %s\n", + get_signame (signo), strerror (errno)); break; } } @@ -377,7 +375,7 @@ @return the parsed argv array */ char** -split_opt_string (const char* const opts) +split_opt_string (const char* opts) { char in_quote = 0; int in_escape = 0; Index: output.cpp =================================================================== --- output.cpp (revision 429667) +++ output.cpp (working copy) @@ -30,16 +30,11 @@ #include /* for exit, free */ #include /* for str* */ -#include - /* for close, dup, exec, fork - remove when removing diff dependancy*/ #include -#include /* for waitpid, W* */ #include #include "cmdopt.h" -#include "exec.h" - /* for get_signame - remove when removing diff dependancy */ #include "util.h" #include "output.h" Index: runall.cpp =================================================================== --- runall.cpp (revision 429667) +++ runall.cpp (working copy) @@ -31,10 +31,7 @@ #include /* for str* */ #include /* for isspace */ -#include - /* for close, dup, exec, fork - remove when removing diff dependancy*/ #include -#include /* for waitpid, W* */ #include @@ -94,12 +91,15 @@ for (/* none */; argv [arg_count]; ++arg_count); /* reallocate memory for copying them, extending the buffer */ - split = (char**)RW_REALLOC (split, (arg_count + 1) * sizeof (char*)); + split = (char**)RW_REALLOC (split, (arg_count + 2) * sizeof (char*)); /* And copy the pointers */ for (i=0; i < arg_count; ++i) split [i+1] = argv [i]; + /* Then terminate the array*/ + split [++i] = (char*)0; + return split; } /* Otherwise, it's a complex executable with 1 or more arguments */ --------------030707030105040003050003--