summaryrefslogtreecommitdiff
path: root/tests/testglib.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2010-10-07 12:04:52 +0300
committerTor Lillqvist <tml@iki.fi>2010-10-07 12:06:48 +0300
commit46390c9d107b6df55de458b3ffe47a5428d7f287 (patch)
tree59b7917e0d9dc57f555508a230d49658072bedac /tests/testglib.c
parent200e3d7307df75803c03a2aebcbba0dc5eaa9161 (diff)
downloadglib-46390c9d107b6df55de458b3ffe47a5428d7f287.tar.gz
Don't call close() on -1
Of course, a proper implementation of close() will just ignore an invalid parameter silently, and set errno. But apparently the "debug" version of the Microsoft C library generates some noise in this case. So avoid that. Thanks to John Emmas for reporting.
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)