summaryrefslogtreecommitdiff
path: root/gio/gresource.c
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2016-05-04 22:59:22 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2016-05-04 23:50:18 +0800
commit217b620a7b7edd2a7b69a28d53fa8bcf7db90a62 (patch)
tree164844e9ee728550c2fb0969169db9c0a1cfff9b /gio/gresource.c
parentc16a0b53fe87decb6521417dd67fcacc55cd8cc5 (diff)
downloadglib-217b620a7b7edd2a7b69a28d53fa8bcf7db90a62.tar.gz
gresource.c: Use g_file_test()
Use the g_file_test() API instead of the g_stat() + S_ISDIR combo to fix builds on compilers that do not support S_ISDIR. https://bugzilla.gnome.org/show_bug.cgi?id=765991
Diffstat (limited to 'gio/gresource.c')
-rw-r--r--gio/gresource.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gio/gresource.c b/gio/gresource.c
index ad510cd5c..59c5b40d5 100644
--- a/gio/gresource.c
+++ b/gio/gresource.c
@@ -248,10 +248,9 @@ enumerate_overlay_dir (const gchar *candidate,
while ((name = g_dir_read_name (dir)))
{
gchar *fullname = g_build_filename (candidate, name, NULL);
- GStatBuf buf;
/* match gvdb behaviour by suffixing "/" on dirs */
- if (g_stat (fullname, &buf) == 0 && S_ISDIR (buf.st_mode))
+ if (g_file_test (fullname, G_FILE_TEST_IS_DIR))
g_hash_table_add (*hash, g_strconcat (name, "/", NULL));
else
g_hash_table_add (*hash, g_strdup (name));