[nemiver] Fix compilation with gcc 4.5



commit 87110c1cb3d894aface86d3679f195c9c63fc960
Author: Dodji Seketeli <dodji redhat com>
Date:   Sun Jul 18 10:37:30 2010 +0200

    Fix compilation with gcc 4.5
    
    	* fork-parent.cc (main): Use the simpler execv instead of execve
    	and pass a non-null second argument to make gcc 4.5 happy.

 tests/fork-parent.cc |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/tests/fork-parent.cc b/tests/fork-parent.cc
index c693e65..147ff4f 100644
--- a/tests/fork-parent.cc
+++ b/tests/fork-parent.cc
@@ -18,7 +18,8 @@ main ()
     } else {
         // we are in the child
         std::cout << "I was forked by my parent. About to exec now" << std::endl;
-        execve ("./forkchild", NULL, NULL);
+	char *const argv[] = {NULL};
+        execv ("./forkchild", argv);
     }
     return 0;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]