Get rid of last remaining "struct stat" variables.
authorAndrej Kacian <ticho@claws-mail.org>
Mon, 29 Jun 2015 09:44:13 +0000 (11:44 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Mon, 29 Jun 2015 09:44:13 +0000 (11:44 +0200)
GStatBuf is used instead.

src/common/socket.c
src/common/ssl_certificate.c
src/compose.c
src/main.c
src/msgcache.c
src/plugins/archive/libarchive_archive.c
src/plugins/libravatar/libravatar_cache.c
src/plugins/mailmbox/mailmbox_folder.c

index 5f8b477..f842c8d 100644 (file)
@@ -218,14 +218,14 @@ void refresh_resolvers(void)
 {
 #ifdef G_OS_UNIX
        static time_t resolv_conf_changed = (time_t)NULL;
-       struct stat s;
+       GStatBuf s;
 
        /* This makes the glibc re-read resolv.conf, if it changed
         * since our startup. Maybe that should be #ifdef'ed, I don't
         * know if it'd work on BSDs.
         * Why doesn't the glibc do it by itself?
         */
-       if (stat("/etc/resolv.conf", &s) == 0) {
+       if (g_stat("/etc/resolv.conf", &s) == 0) {
                if (s.st_mtime > resolv_conf_changed) {
                        resolv_conf_changed = s.st_mtime;
                        res_init();
index 013f96e..b926a58 100644 (file)
@@ -224,7 +224,7 @@ static int gnutls_import_X509_list_fp(FILE *fp, gnutls_x509_crt_fmt_t format,
        unsigned int max = 512;
        unsigned int flags = 0;
        gnutls_datum_t tmp;
-       struct stat s;
+       GStatBuf s;
        int r;
 
        *cert_list = NULL;
@@ -292,7 +292,7 @@ static gnutls_x509_privkey_t gnutls_import_key_fp(FILE *fp, gnutls_x509_crt_fmt_
 {
        gnutls_x509_privkey_t key = NULL;
        gnutls_datum_t tmp;
-       struct stat s;
+       GStatBuf s;
        int r;
        if (fstat(fileno(fp), &s) < 0) {
                perror("fstat");
@@ -322,7 +322,7 @@ static gnutls_pkcs12_t gnutls_import_PKCS12_fp(FILE *fp, gnutls_x509_crt_fmt_t f
 {
        gnutls_pkcs12_t p12 = NULL;
        gnutls_datum_t tmp;
-       struct stat s;
+       GStatBuf s;
        int r;
        if (fstat(fileno(fp), &s) < 0) {
                log_error(LOG_PROTOCOL, _("Cannot stat P12 certificate file (%s)\n"),
index 72c3fd4..149eae9 100644 (file)
@@ -10064,7 +10064,7 @@ warn_err:
                compose_close(compose);
                return TRUE;
        } else {
-               struct stat s;
+               GStatBuf s;
                gchar *path;
 
                path = folder_item_fetch_msg(draft, msgnum);
index 9ce01ba..3011800 100644 (file)
@@ -2140,7 +2140,7 @@ gchar *claws_get_socket_name(void)
        gchar md5sum[33];
 
        if (filename == NULL) {
-               struct stat st;
+               GStatBuf st;
                gint stat_ok;
 
                socket_dir = g_strdup_printf("%s%cclaws-mail-%d",
index 82480ed..ac05167 100644 (file)
@@ -581,7 +581,7 @@ MsgCache *msgcache_read_cache(FolderItem *item, const gchar *cache_file)
        guint memusage = 0;
        gint tmp_len = 0, map_len = -1;
        char *cache_data = NULL;
-       struct stat st;
+       GStatBuf st;
 
        cm_return_val_if_fail(cache_file != NULL, NULL);
        cm_return_val_if_fail(item != NULL, NULL);
@@ -804,7 +804,7 @@ void msgcache_read_mark(MsgCache *cache, const gchar *mark_file)
        guint32 num;
        gint map_len = -1;
        char *cache_data = NULL;
-       struct stat st;
+       GStatBuf st;
        gboolean error = FALSE;
 
        swapping = TRUE;
@@ -898,7 +898,7 @@ void msgcache_read_tags(MsgCache *cache, const gchar *tags_file)
        guint32 num;
        gint map_len = -1;
        char *cache_data = NULL;
-       struct stat st;
+       GStatBuf st;
        gboolean error = FALSE;
 
        swapping = TRUE;
index 8266c00..47fbd30 100644 (file)
@@ -470,7 +470,7 @@ const gchar* archive_create(const char* archive_name, GSList* files,
        char* buf = NULL;
        ssize_t len;
        int fd;
-       struct stat st;
+       GStatBuf st;
        struct file_info* file;
        gchar* filename = NULL;
        gchar* msg = NULL;
index 7f72b0e..04e1f60 100644 (file)
@@ -54,7 +54,7 @@ gchar *libravatar_cache_init(const char *dirs[], gint start, gint end)
 
 static void cache_stat_item(gpointer filename, gpointer data)
 {
-       struct stat             s;
+       GStatBuf                s;
        const gchar             *fname = (const gchar *) filename;
        AvatarCacheStats        *stats = (AvatarCacheStats *) data;
 
index 5197ab5..4058c82 100644 (file)
@@ -683,7 +683,7 @@ static gint claws_mailmbox_add_msgs(Folder *folder, FolderItem *dest,
         
        for (cur = file_list; cur != NULL; cur = cur->next) {
                 int fd;
-                struct stat stat_info;
+                GStatBuf stat_info;
                 char * data;
                 size_t len;
                 struct claws_mailmbox_msg_info * msg;