[phodav] spice-webdavd-windows: Alert when CreateFile fails



commit 625d69eb3efdd4459b6f117618f7794d6e1c72a1
Author: Lukas Venhoda <lvenhoda redhat com>
Date:   Thu Mar 17 14:47:47 2016 +0100

    spice-webdavd-windows: Alert when CreateFile fails
    
    Shows alert on windows when CreateFile fails.
    This can happen, when webdavd is run without administrator privileges.
    
    Acked-by: Marc-André Lureau <mlureau redhat com>
    Acked-by: Victor Toso <victortoso redhat com>

 spice/spice-webdavd.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
index c8fb795..b3fd1ea 100644
--- a/spice/spice-webdavd.c
+++ b/spice/spice-webdavd.c
@@ -722,7 +722,9 @@ open_mux_path (const char *path)
                          OPEN_EXISTING,
                          FILE_FLAG_OVERLAPPED,
                          NULL);
-  g_assert (port_handle != INVALID_HANDLE_VALUE);
+
+  if (port_handle == INVALID_HANDLE_VALUE)
+      g_error ("%s", g_win32_error_message (GetLastError ()));
 
   mux_ostream = G_OUTPUT_STREAM (g_win32_output_stream_new (port_handle, TRUE));
   mux_istream = G_INPUT_STREAM (g_win32_input_stream_new (port_handle, TRUE));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]