Skip to contentSkip to conversation

[6653] Remove some warnings and fix windows build.

Qemu-devel Anthony Liguori 1 participant 1 message Feb 27, 2009

lore
Share & tools
lore
#0 lore raw

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.

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

Modified: trunk/hw/acpi.c
===================================================================

hw/acpi.c +2 -2
@@ -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
===================================================================

vl.c +2 -2
@@ -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;