Minor, improve file reading failing condition comment

https://bugzilla.gnome.org/show_bug.cgi?id=659212 for more context
This commit is contained in:
Ebrahim Byagowi 2018-04-25 16:44:04 +04:30 committed by GitHub
parent 2eaba80cbd
commit 5ad87a93fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -577,7 +577,8 @@ hb_blob_create_from_file (const char *file_name)
struct stat st; struct stat st;
if (unlikely (fstat (fd, &st) == -1)) goto fail; if (unlikely (fstat (fd, &st) == -1)) goto fail;
// If the file size is 0 and isn't regular, give up // If the file size is 0 and is a regular file, give up
// See https://github.com/GNOME/glib/blob/f9faac7/glib/gmappedfile.c#L139-L142
if (unlikely (st.st_size == 0 && S_ISREG (st.st_mode))) goto fail; if (unlikely (st.st_size == 0 && S_ISREG (st.st_mode))) goto fail;
file->length = (unsigned long) st.st_size; file->length = (unsigned long) st.st_size;