qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [6653] Remove some warnings and fix windows build.


From: Anthony Liguori
Subject: [Qemu-devel] [6653] Remove some warnings and fix windows build.
Date: Fri, 27 Feb 2009 22:16:48 +0000

Revision: 6653
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6653
Author:   aliguori
Date:     2009-02-27 22:16:47 +0000 (Fri, 27 Feb 2009)
Log Message:
-----------
Remove some warnings and fix windows build.

Initialize some variables to make GCC happy and switch from using index to
strchr.  index is not available on Windows.

Signed-off-by: Anthony Liguori <address@hidden>

Modified Paths:
--------------
    trunk/hw/acpi.c
    trunk/vl.c

Modified: trunk/hw/acpi.c
===================================================================
--- trunk/hw/acpi.c     2009-02-27 22:09:45 UTC (rev 6652)
+++ trunk/hw/acpi.c     2009-02-27 22:16:47 UTC (rev 6653)
@@ -841,7 +841,7 @@
     f = buf;
     while (buf[0]) {
         struct stat s;
-        char *n = index(f, ':');
+        char *n = strchr(f, ':');
         if (n)
             *n = '\0';
         if(stat(f, &s) < 0) {
@@ -873,7 +873,7 @@
     while (buf[0]) {
         struct stat s;
         int fd;
-        char *n = index(f, ':');
+        char *n = strchr(f, ':');
         if (n)
             *n = '\0';
         fd = open(f, O_RDONLY);

Modified: trunk/vl.c
===================================================================
--- trunk/vl.c  2009-02-27 22:09:45 UTC (rev 6652)
+++ trunk/vl.c  2009-02-27 22:16:47 UTC (rev 6653)
@@ -4641,8 +4641,8 @@
     const char *pid_file = NULL;
     int autostart;
     const char *incoming = NULL;
-    int fd;
-    struct passwd *pwd;
+    int fd = 0;
+    struct passwd *pwd = NULL;
     const char *chroot_dir = NULL;
     const char *run_as = NULL;
 





reply via email to

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