From 0d10dd9fe522c2ef707ebc12ea403287a601381b Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Thu, 26 Apr 2018 11:25:14 +0200 Subject: [PATCH] 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); }