summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--cmd.c23
-rwxr-xr-xconfigure2
-rw-r--r--qemu-io.c2
3 files changed, 26 insertions, 1 deletions
diff --git a/cmd.c b/cmd.c
index f3f4385643..d86ba7ccb4 100644
--- a/cmd.c
+++ b/cmd.c
@@ -20,6 +20,7 @@
 #include <string.h>
 #include <ctype.h>
 #include <errno.h>
+#include <sys/time.h>
 
 #include "cmd.h"
 
@@ -283,6 +284,26 @@ fetchline(void)
 }
 #endif
 
+static char *qemu_strsep(char **input, const char *delim)
+{
+    char *result = *input;
+    if (result != NULL) {
+    char *p = result;
+    for (p = result; *p != '\0'; p++) {
+        if (strchr(delim, *p)) {
+                break;
+            }
+        }
+        if (*p == '\0') {
+            *input = NULL;
+        } else {
+            *p = '\0';
+            *input = p + 1;
+        }
+    }
+    return result;
+}
+
 char **
 breakline(
 	char	*input,
@@ -292,7 +313,7 @@ breakline(
 	char	*p;
 	char	**rval = calloc(sizeof(char *), 1);
 
-	while (rval && (p = strsep(&input, " ")) != NULL) {
+	while (rval && (p = qemu_strsep(&input, " ")) != NULL) {
 		if (!*p)
 			continue;
 		c++;
diff --git a/configure b/configure
index b78341ccc2..618e4dce21 100755
--- a/configure
+++ b/configure
@@ -1929,6 +1929,8 @@ if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
     if [ "$check_utests" = "yes" ]; then
       tools="check-qint check-qstring check-qdict $tools"
     fi
+  elif test "$mingw32" = "yes" ; then
+      tools="qemu-io\$(EXESUF) $tools"
   fi
 fi
 echo "TOOLS=$tools" >> $config_host_mak
diff --git a/qemu-io.c b/qemu-io.c
index f96a4de6b4..cac72e9603 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -7,10 +7,12 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+#include <sys/time.h>
 #include <sys/types.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <getopt.h>
+#include <libgen.h>
 
 #include "qemu-common.h"
 #include "block_int.h"