From 1ba6a3d6cae9ee001abf6ec373565a7abff23da6 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 17 Feb 2017 19:36:31 +0000 Subject: [PATCH] test-utils-glib: Windows: add errno.h for ENOENT, skip EINTR checks Windows apparently has and uses ENOENT for _unlink(), so this should be safe enough. EINTR is very much a POSIX thing, so ignore that on Windows. Signed-off-by: Simon McVittie --- test/test-utils-glib.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/test-utils-glib.c b/test/test-utils-glib.c index 0d4c85a4..e13d20d3 100644 --- a/test/test-utils-glib.c +++ b/test/test-utils-glib.c @@ -27,13 +27,13 @@ #include #include "test-utils-glib.h" +#include #include #ifdef DBUS_WIN # include # include #else -# include # include # include # include @@ -516,8 +516,10 @@ test_remove_if_exists (const gchar *path) if (saved_errno == ENOENT) return; +#ifdef G_OS_UNIX if (saved_errno == EINTR) continue; +#endif g_error ("Unable to remove file \"%s\": %s", path, g_strerror (saved_errno)); @@ -535,8 +537,10 @@ test_rmdir_must_exist (const gchar *path) { int saved_errno = errno; +#ifdef G_OS_UNIX if (saved_errno == EINTR) continue; +#endif g_error ("Unable to remove directory \"%s\": %s", path, g_strerror (saved_errno)); @@ -557,8 +561,10 @@ test_rmdir_if_exists (const gchar *path) if (saved_errno == ENOENT) return; +#ifdef G_OS_UNIX if (saved_errno == EINTR) continue; +#endif g_error ("Unable to remove directory \"%s\": %s", path, g_strerror (saved_errno)); @@ -577,8 +583,10 @@ test_mkdir (const gchar *path, { int saved_errno = errno; +#ifdef G_OS_UNIX if (saved_errno == EINTR) continue; +#endif g_error ("Unable to create directory \"%s\": %s", path, g_strerror (saved_errno)); -- 2.11.0