aboutsummaryrefslogtreecommitdiff
path: root/util/oslib-win32.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-08-18 12:00:59 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-30 19:11:36 +0200
commit9386a4a7150fe11690af1897cf28c206c54cde9c (patch)
tree72a0dc762a33cdf398b53cb4f36490759bf0ea13 /util/oslib-win32.c
parentec986777accd688c1b7159778c9cc729e54a87f4 (diff)
oslib-posix: default exec_dir to bindir
If the exec_dir cannot be retrieved, just assume it's the installation directory that was specified at configure time. This makes it simpler to reason about what the callers will do if they get back an empty path. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'util/oslib-win32.c')
-rw-r--r--util/oslib-win32.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 1a33912944..051afb217b 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -315,7 +315,7 @@ void qemu_set_tty_echo(int fd, bool echo)
}
}
-static char *exec_dir;
+static const char *exec_dir;
void qemu_init_exec_dir(const char *argv0)
{
@@ -341,6 +341,8 @@ void qemu_init_exec_dir(const char *argv0)
*p = 0;
if (access(buf, R_OK) == 0) {
exec_dir = g_strdup(buf);
+ } else {
+ exec_dir = CONFIG_BINDIR;
}
}