[glib] gresource.c: Use g_file_test()



commit 217b620a7b7edd2a7b69a28d53fa8bcf7db90a62
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed May 4 22:59:22 2016 +0800

    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

 gio/gresource.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/gio/gresource.c b/gio/gresource.c
index ad510cd..59c5b40 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));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]