[dia] Use g_stat() rather than stat()



commit 1ba172fb9e17a2b9fcf315b6ec3156eeb5437080
Author: Hans Breuer <hans breuer org>
Date:   Mon Aug 10 12:35:11 2009 +0200

    Use g_stat() rather than stat()

 lib/plug-ins.c |    4 ++--
 lib/sheet.c    |    5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/lib/plug-ins.c b/lib/plug-ins.c
index 369c987..695bd33 100644
--- a/lib/plug-ins.c
+++ b/lib/plug-ins.c
@@ -25,12 +25,12 @@
 #include <string.h>
 #include <errno.h>
 #include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
+#include <glib/gstdio.h>
 #include <libxml/xmlmemory.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
@@ -295,7 +295,7 @@ for_each_in_dir(const gchar *directory, ForEachInDirDoFunc dofunc,
   GDir *dp;
   GError *error = NULL;
 
-  if (stat(directory, &statbuf) < 0)
+  if (g_stat(directory, &statbuf) < 0)
     return;
 
   dp = g_dir_open(directory, 0, &error);
diff --git a/lib/sheet.c b/lib/sheet.c
index 84c62ac..045f001 100644
--- a/lib/sheet.c
+++ b/lib/sheet.c
@@ -26,6 +26,7 @@
 #include <unistd.h>
 #endif
 #include <glib.h>
+#include <glib/gstdio.h> /* g_stat() */
 #include <libxml/tree.h>
 #include <libxml/parser.h>
 #include <libxml/xmlmemory.h>
@@ -302,10 +303,10 @@ load_register_sheet(const gchar *dirname, const gchar *filename,
       struct stat first_file, this_file;
       int stat_ret;
       
-      stat_ret = stat(((Sheet *)(sheetp->data))->filename, &first_file);
+      stat_ret = g_stat(((Sheet *)(sheetp->data))->filename, &first_file);
       g_assert(!stat_ret);
 
-      stat_ret = stat(filename, &this_file);
+      stat_ret = g_stat(filename, &this_file);
       g_assert(!stat_ret);
 
       if (this_file.st_mtime > first_file.st_mtime)



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