From 4b955c34ba07d0c520da37fc1d201de732302a71 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Tue, 30 Jun 2015 23:38:31 +0200 Subject: [PATCH] Do not use GStatBuf with non-Glib *stat() functions. Also fix up on forgotten stat() to g_stat(). --- src/common/ssl_certificate.c | 6 +++--- src/main.c | 2 +- src/msgcache.c | 6 +++--- src/plugins/archive/libarchive_archive.c | 4 +--- src/plugins/mailmbox/mailmbox_folder.c | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/common/ssl_certificate.c b/src/common/ssl_certificate.c index b926a5899..013f96ed6 100644 --- a/src/common/ssl_certificate.c +++ b/src/common/ssl_certificate.c @@ -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; - GStatBuf s; + struct stat 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; - GStatBuf s; + struct stat 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; - GStatBuf s; + struct stat s; int r; if (fstat(fileno(fp), &s) < 0) { log_error(LOG_PROTOCOL, _("Cannot stat P12 certificate file (%s)\n"), diff --git a/src/main.c b/src/main.c index 3011800ae..3605ad411 100644 --- a/src/main.c +++ b/src/main.c @@ -2150,7 +2150,7 @@ gchar *claws_get_socket_name(void) #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)); diff --git a/src/msgcache.c b/src/msgcache.c index ac0516775..82480ed9c 100644 --- a/src/msgcache.c +++ b/src/msgcache.c @@ -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; - GStatBuf st; + struct stat 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; - GStatBuf st; + struct stat 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; - GStatBuf st; + struct stat st; gboolean error = FALSE; swapping = TRUE; diff --git a/src/plugins/archive/libarchive_archive.c b/src/plugins/archive/libarchive_archive.c index 47fbd302a..aa5ca2dea 100644 --- a/src/plugins/archive/libarchive_archive.c +++ b/src/plugins/archive/libarchive_archive.c @@ -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 @@ -470,7 +468,7 @@ const gchar* archive_create(const char* archive_name, GSList* files, char* buf = NULL; ssize_t len; int fd; - GStatBuf st; + struct stat st; struct file_info* file; gchar* filename = NULL; gchar* msg = NULL; diff --git a/src/plugins/mailmbox/mailmbox_folder.c b/src/plugins/mailmbox/mailmbox_folder.c index 4058c82e9..5197ab561 100644 --- a/src/plugins/mailmbox/mailmbox_folder.c +++ b/src/plugins/mailmbox/mailmbox_folder.c @@ -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; - GStatBuf stat_info; + struct stat stat_info; char * data; size_t len; struct claws_mailmbox_msg_info * msg; -- 2.25.1