testglib: test_file_functions: don't close fd if it's -1

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
This commit is contained in:
Simon McVittie 2011-12-12 15:55:59 +00:00
parent fedc0cff51
commit a0f5e89aed

View File

@ -952,7 +952,8 @@ test_file_functions (void)
else
g_print ("g_file_open_tmp correctly returns error: %s\n", error->message);
}
close (fd);
if (fd != -1)
close (fd);
g_clear_error (&error);
#ifdef G_OS_WIN32