diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2010-03-20 08:26:27 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-03-20 08:26:27 +0000 |
commit | 9b164805a3dba7368a7ea715cf6c585d605b2486 (patch) | |
tree | 864f88d582eb5882458a316e10e554c2b04d5da6 /vl.c | |
parent | 80a1ab598c6960e7a941e38c5d8638c532c585c3 (diff) |
Fix mingw32 build
mkdir() only takes path argument on mingw32:
CC i386-softmmu/vl.o
/src/qemu/vl.c: In function 'qmp_add_default':
/src/qemu/vl.c:3763: error: too many arguments to function 'mkdir'
/src/qemu/vl.c:3769: error: too many arguments to function 'mkdir'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -3743,7 +3743,8 @@ static void qmp_add_default(void) const char *home; static uint8_t null_uuid[16]; uint8_t uuid[16]; - + int ret; + home = getenv("HOME"); if (!home) { return; @@ -3760,13 +3761,23 @@ static void qmp_add_default(void) } snprintf(buffer, sizeof(buffer), "%s/.qemu", home); - if (mkdir(buffer, 0755) == -1 && errno != EEXIST) { +#ifdef __MINGW32__ + ret = mkdir(buffer); +#else + ret = mkdir(buffer, 0755); +#endif + if (ret == -1 && errno != EEXIST) { fprintf(stderr, "could not open default QMP port\n"); return; } snprintf(buffer, sizeof(buffer), "%s/.qemu/qmp", home); - if (mkdir(buffer, 0755) == -1 && errno != EEXIST) { +#ifdef __MINGW32__ + ret = mkdir(buffer); +#else + ret = mkdir(buffer, 0755); +#endif + if (ret == -1 && errno != EEXIST) { fprintf(stderr, "could not open default QMP port\n"); return; } |