summaryrefslogtreecommitdiff
path: root/tests/testglib.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testglib.c')
-rw-r--r--tests/testglib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/testglib.c b/tests/testglib.c
index 762592858..b4e29f07b 100644
--- a/tests/testglib.c
+++ b/tests/testglib.c
@@ -886,7 +886,8 @@ test_file_functions (void)
fd = g_mkstemp (template);
if (g_test_verbose() && fd != -1)
g_print ("g_mkstemp works even if template doesn't end in XXXXXX\n");
- close (fd);
+ if (fd != -1)
+ close (fd);
strcpy (template, "fooXXXXXX");
fd = g_mkstemp (template);
if (fd == -1)