[glib] tests/autoptr: Don't use /dev/null under Windows



commit 0d10dd9fe522c2ef707ebc12ea403287a601381b
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Thu Apr 26 11:25:14 2018 +0200

    tests/autoptr: Don't use /dev/null under Windows
    
    Use the "nul" device instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795569

 glib/tests/autoptr.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/glib/tests/autoptr.c b/glib/tests/autoptr.c
index ca6ae3464..408f14b6c 100644
--- a/glib/tests/autoptr.c
+++ b/glib/tests/autoptr.c
@@ -97,7 +97,13 @@ test_g_hmac (void)
 static void
 test_g_io_channel (void)
 {
-  g_autoptr(GIOChannel) val = g_io_channel_new_file ("/dev/null", "r", NULL);
+#ifdef G_OS_WIN32
+  const gchar *devnull = "nul";
+#else
+  const gchar *devnull = "/dev/null";
+#endif
+
+  g_autoptr(GIOChannel) val = g_io_channel_new_file (devnull, "r", NULL);
   g_assert (val != NULL);
 }
 


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