mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-28 10:06:53 +02:00
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.
This commit is contained in:
parent
200e3d7307
commit
46390c9d10
@ -886,7 +886,8 @@ test_file_functions (void)
|
|||||||
fd = g_mkstemp (template);
|
fd = g_mkstemp (template);
|
||||||
if (g_test_verbose() && fd != -1)
|
if (g_test_verbose() && fd != -1)
|
||||||
g_print ("g_mkstemp works even if template doesn't end in XXXXXX\n");
|
g_print ("g_mkstemp works even if template doesn't end in XXXXXX\n");
|
||||||
close (fd);
|
if (fd != -1)
|
||||||
|
close (fd);
|
||||||
strcpy (template, "fooXXXXXX");
|
strcpy (template, "fooXXXXXX");
|
||||||
fd = g_mkstemp (template);
|
fd = g_mkstemp (template);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user