[phodav: 7/14] spice: print err when g_open fails
- From: Marc-André Lureau <malureau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [phodav: 7/14] spice: print err when g_open fails
- Date: Wed, 29 May 2019 12:49:30 +0000 (UTC)
commit a8ade597691b4dd443df6108dfc8da1c6d3f2b9e
Author: Jakub Janků <jjanku redhat com>
Date: Sun May 12 13:09:44 2019 +0200
spice: print err when g_open fails
Don't fail silently when we cannot open the webdav virtio port.
Signed-off-by: Jakub Janků <jjanku redhat com>
spice/spice-webdavd.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
index a6a4fb1..4d3ca7e 100644
--- a/spice/spice-webdavd.c
+++ b/spice/spice-webdavd.c
@@ -25,6 +25,7 @@
#include <fcntl.h>
#include <glib/gstdio.h>
#include <glib-unix.h>
+#include <errno.h>
#endif
#ifdef G_OS_WIN32
@@ -712,8 +713,12 @@ open_mux_path (const char *path)
g_debug ("Open %s", path);
#ifdef G_OS_UNIX
port_fd = g_open (path, O_RDWR);
+ gint errsv = errno;
if (port_fd == -1)
+ {
+ g_printerr("Failed to open %s: %s\n", path, g_strerror(errsv));
exit (1);
+ }
wait_for_virtio_host (port_fd);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]