stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r429912 - in /incubator/stdcxx/trunk/util: cmdopt.cpp output.cpp runall.cpp
Date Wed, 09 Aug 2006 01:24:19 GMT
Author: sebor
Date: Tue Aug  8 18:24:19 2006
New Revision: 429912

URL: http://svn.apache.org/viewvc?rev=429912&view=rev
Log:
2006-08-07  Andrew Black  <ablack@roguewave.com>

	* cmdopt.cpp (eval_options): Used raise(signal) rather than
        kill(getpid (), signal).
	* runall.cpp (merge_argv): Added missing terminator to generated
	array for bare executables.
	* cmdopt.cpp, output.cpp, runall.cpp: Removed unneeded #includes.

Modified:
    incubator/stdcxx/trunk/util/cmdopt.cpp
    incubator/stdcxx/trunk/util/output.cpp
    incubator/stdcxx/trunk/util/runall.cpp

Modified: incubator/stdcxx/trunk/util/cmdopt.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/cmdopt.cpp?rev=429912&r1=429911&r2=429912&view=diff
==============================================================================
--- incubator/stdcxx/trunk/util/cmdopt.cpp (original)
+++ incubator/stdcxx/trunk/util/cmdopt.cpp Tue Aug  8 18:24:19 2006
@@ -31,11 +31,11 @@
 #include <assert.h>
 #include <ctype.h> /* for isspace */
 #include <errno.h> /* for errno */
-#include <signal.h> /* for kill, SIG_IGN */
+#include <signal.h> /* for raise, signal, SIG_IGN */
 #include <stdio.h> /* for *printf, fputs */
 #include <stdlib.h> /* for exit */
 #include <string.h> /* for str* */
-#include <unistd.h> /* for getpid */
+#include <unistd.h> /* for sleep */
 
 #include "exec.h"
 #include "util.h"
@@ -316,10 +316,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 +376,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;

Modified: incubator/stdcxx/trunk/util/output.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/output.cpp?rev=429912&r1=429911&r2=429912&view=diff
==============================================================================
--- incubator/stdcxx/trunk/util/output.cpp (original)
+++ incubator/stdcxx/trunk/util/output.cpp Tue Aug  8 18:24:19 2006
@@ -30,16 +30,11 @@
 #include <stdlib.h> /* for exit, free */
 #include <string.h> /* for str* */
 
-#include <unistd.h>
-    /* for close, dup, exec, fork - remove when removing diff dependancy*/
 #include <sys/types.h>
-#include <sys/wait.h> /* for waitpid, W* */
 
 #include <sys/stat.h>
 
 #include "cmdopt.h"
-#include "exec.h"
-    /* for get_signame - remove when removing diff dependancy */
 #include "util.h"
 
 #include "output.h"

Modified: incubator/stdcxx/trunk/util/runall.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/runall.cpp?rev=429912&r1=429911&r2=429912&view=diff
==============================================================================
--- incubator/stdcxx/trunk/util/runall.cpp (original)
+++ incubator/stdcxx/trunk/util/runall.cpp Tue Aug  8 18:24:19 2006
@@ -31,10 +31,7 @@
 #include <string.h> /* for str* */
 
 #include <ctype.h> /* for isspace */
-#include <unistd.h>
-    /* for close, dup, exec, fork - remove when removing diff dependancy*/
 #include <sys/types.h>
-#include <sys/wait.h> /* for waitpid, W* */
 
 #include <sys/stat.h>
 
@@ -94,11 +91,14 @@
         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 */



Mime
View raw message