Issue #15501: g_close failed with EBADF. This is not a valid file descriptor.
I can't reproduce this issue, because when I set a fake font file as a broken symlink, or a file without read access, it is simply not returned as part of my font list to start with. But from the issue discussion and traces, this should be the right fix.
This commit is contained in:
parent
75fd88e881
commit
98bd0d16fe
1 changed files with 10 additions and 1 deletions
|
|
@ -860,7 +860,16 @@ gimp_font_factory_load_names (GimpFontFactory *factory)
|
|||
*/
|
||||
{
|
||||
char buf[4] = {0};
|
||||
int fd = g_open ((gchar *) file, O_RDONLY, 0);
|
||||
int fd;
|
||||
|
||||
errno = 0;
|
||||
fd = g_open ((gchar *) file, O_RDONLY, 0);
|
||||
if (fd == -1)
|
||||
{
|
||||
g_string_append_printf (ignored_fonts, "- %s (access error: %s)\n", file, strerror (errno));
|
||||
n_ignored++;
|
||||
continue;
|
||||
}
|
||||
|
||||
read (fd, buf, 4);
|
||||
g_close (fd, NULL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue