changeset 517:f337b3e25cbf

Fix the datatype of argv in fork_and_exec() and cast it for execve(2). Eliminates a gcc 4.2.1 warning on FreeBSD 7.
author kurt
date Fri, 16 Jan 2009 13:21:53 -0500
parents 36e8a25a0058
children 6e1e3c98ccdf
files src/os/bsd/vm/os_bsd.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/bsd/vm/os_bsd.cpp	Wed Jan 14 11:53:48 2009 -0500
+++ b/src/os/bsd/vm/os_bsd.cpp	Fri Jan 16 13:21:53 2009 -0500
@@ -5197,7 +5197,7 @@
 // Unlike system(), this function can be called from signal handler. It
 // doesn't block SIGINT et al.
 int os::fork_and_exec(char* cmd) {
-  char * const argv[4] = {"sh", "-c", cmd, NULL};
+  const char * argv[4] = {"sh", "-c", cmd, NULL};
 
   // fork() in BsdThreads/NPTL is not async-safe. It needs to run
   // pthread_atfork handlers and reset pthread library. All we need is a
@@ -5220,7 +5220,7 @@
     // in the new process, so make a system call directly.
     // IA64 should use normal execve() from glibc to match the glibc fork()
     // above.
-    execve("/bin/sh", argv, environ);
+    execve("/bin/sh", (char* const*)argv, environ);
 
     // execve failed
     _exit(-1);