Do not use GStatBuf with non-Glib *stat() functions.
authorAndrej Kacian <ticho@claws-mail.org>
Tue, 30 Jun 2015 21:38:31 +0000 (23:38 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Tue, 30 Jun 2015 21:38:31 +0000 (23:38 +0200)
Also fix up on forgotten stat() to g_stat().

src/common/ssl_certificate.c
src/main.c
src/msgcache.c
src/plugins/archive/libarchive_archive.c
src/plugins/mailmbox/mailmbox_folder.c

index b926a5899b145d2d065122a525b16de50ed39c76..013f96ed660635b757b9734e14985d1a0c77fa25 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;
        unsigned int max = 512;
        unsigned int flags = 0;
        gnutls_datum_t tmp;
-       GStatBuf s;
+       struct stat s;
        int r;
 
        *cert_list = NULL;
        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;
 {
        gnutls_x509_privkey_t key = NULL;
        gnutls_datum_t tmp;
-       GStatBuf s;
+       struct stat s;
        int r;
        if (fstat(fileno(fp), &s) < 0) {
                perror("fstat");
        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;
 {
        gnutls_pkcs12_t p12 = NULL;
        gnutls_datum_t tmp;
-       GStatBuf s;
+       struct stat s;
        int r;
        if (fstat(fileno(fp), &s) < 0) {
                log_error(LOG_PROTOCOL, _("Cannot stat P12 certificate file (%s)\n"),
        int r;
        if (fstat(fileno(fp), &s) < 0) {
                log_error(LOG_PROTOCOL, _("Cannot stat P12 certificate file (%s)\n"),
index 3011800ae0caeff76b1b1dc02f0ab7b3ead23181..3605ad4114149aa39191db2463ae41e589ba0b66 100644 (file)
@@ -2150,7 +2150,7 @@ gchar *claws_get_socket_name(void)
 #else
                                           0);
 #endif
 #else
                                           0);
 #endif
-               stat_ok = stat(socket_dir, &st);
+               stat_ok = g_stat(socket_dir, &st);
                if (stat_ok < 0 && errno != ENOENT) {
                        g_print("Error stat'ing socket_dir %s: %s\n",
                                socket_dir, g_strerror(errno));
                if (stat_ok < 0 && errno != ENOENT) {
                        g_print("Error stat'ing socket_dir %s: %s\n",
                                socket_dir, g_strerror(errno));
index ac05167751612a26792e8cad753d64cf3cd6fe79..82480ed9c10b7d02babd720098ac9633860599e9 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;
        guint memusage = 0;
        gint tmp_len = 0, map_len = -1;
        char *cache_data = NULL;
-       GStatBuf st;
+       struct stat st;
 
        cm_return_val_if_fail(cache_file != NULL, NULL);
        cm_return_val_if_fail(item != NULL, NULL);
 
        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;
        guint32 num;
        gint map_len = -1;
        char *cache_data = NULL;
-       GStatBuf st;
+       struct stat st;
        gboolean error = FALSE;
 
        swapping = TRUE;
        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;
        guint32 num;
        gint map_len = -1;
        char *cache_data = NULL;
-       GStatBuf st;
+       struct stat st;
        gboolean error = FALSE;
 
        swapping = TRUE;
        gboolean error = FALSE;
 
        swapping = TRUE;
index 47fbd302a88d94ca97195524e81e4a55ab9295b5..aa5ca2dea0f2efe0fae6c6acea874d489535669d 100644 (file)
@@ -1,5 +1,3 @@
-/* vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: */
-
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
  * Copyright (C) 1999-2008 Michael Rasmussen and the Claws Mail Team
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
  * Copyright (C) 1999-2008 Michael Rasmussen and the Claws Mail Team
@@ -470,7 +468,7 @@ const gchar* archive_create(const char* archive_name, GSList* files,
        char* buf = NULL;
        ssize_t len;
        int fd;
        char* buf = NULL;
        ssize_t len;
        int fd;
-       GStatBuf st;
+       struct stat st;
        struct file_info* file;
        gchar* filename = NULL;
        gchar* msg = NULL;
        struct file_info* file;
        gchar* filename = NULL;
        gchar* msg = NULL;
index 4058c82e949b34ec7f446483b3b5c3474e8168fa..5197ab56142b874c32d15a07f49dbfe3f1e54406 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;
         
        for (cur = file_list; cur != NULL; cur = cur->next) {
                 int fd;
-                GStatBuf stat_info;
+                struct stat stat_info;
                 char * data;
                 size_t len;
                 struct claws_mailmbox_msg_info * msg;
                 char * data;
                 size_t len;
                 struct claws_mailmbox_msg_info * msg;