qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] a tiny bug, exit(1) should read _exit(1)


From: Kamo Hiroyasu
Subject: [Qemu-devel] a tiny bug, exit(1) should read _exit(1)
Date: Sat, 26 Nov 2005 03:05:59 +0900 (JST)

I have found an unsuitable use of exit() in net_tun_init(), vl.c.
Here is a patch.

Kamo Hiroyasu
[Kamo is the family name and Hiroyasu the given name.]

--- vl.c.orig   2005-11-26 02:23:10.000000000 +0900
+++ vl.c        2005-11-26 02:25:39.000000000 +0900
@@ -1692,8 +1692,6 @@
 static int net_tun_init(NetDriverState *nd)
 {
     int pid, status;
-    char *args[3];
-    char **parg;
 
     nd->fd = tun_open(nd->ifname, sizeof(nd->ifname));
     if (nd->fd < 0)
@@ -1703,12 +1701,8 @@
     pid = fork();
     if (pid >= 0) {
         if (pid == 0) {
-            parg = args;
-            *parg++ = network_script;
-            *parg++ = nd->ifname;
-            *parg++ = NULL;
-            execv(network_script, args);
-            exit(1);
+            execl(network_script, network_script, nd->ifname, NULL);
+            _exit(1);
         }
         while (waitpid(pid, &status, 0) != pid);
         if (!WIFEXITED(status) ||




reply via email to

[Prev in Thread] Current Thread [Next in Thread]