[Spice-devel] [PATCH phodav 06/13] spice: print err when g_open fails
Marc-André Lureau
marcandre.lureau at gmail.com
Thu May 23 13:37:02 UTC 2019
On Thu, May 23, 2019 at 10:37 AM Jakub Janků <jjanku at redhat.com> wrote:
>
> Don't fail silently when we cannot open the webdav virtio port.
>
> Signed-off-by: Jakub Janků <jjanku at redhat.com>
ack
> ---
> spice/spice-webdavd.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
> index 3fac28b..d9b1fae 100644
> --- a/spice/spice-webdavd.c
> +++ b/spice/spice-webdavd.c
> @@ -24,6 +24,7 @@
> #include <gio/gunixoutputstream.h>
> #include <fcntl.h>
> #include <glib/gstdio.h>
> +#include <errno.h>
> #endif
>
> #ifdef G_OS_WIN32
> @@ -703,8 +704,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);
>
> --
> 2.21.0
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
--
Marc-André Lureau
More information about the Spice-devel
mailing list