talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit dc7dfb44b11da99cee879e25f9075cb816638d4f
parent 9121905e6511bb40b2c499a2472f54cd784b111f
Author: Colin Leroy <colin@colino.net>
Date:   Sat,  6 Oct 2018 13:00:00 +0200

Fix build

Diffstat:
Msrc/Makefile.am | 2--
Msrc/addrbook.c | 2+-
Msrc/addrindex.c | 2+-
Msrc/common/Makefile.am | 3++-
Asrc/common/claws_io.c | 47+++++++++++++++++++++++++++++++++++++++++++++++
Asrc/common/claws_io.h | 24++++++++++++++++++++++++
Msrc/common/log.c | 2+-
Msrc/common/prefs.c | 2+-
Msrc/common/ssl_certificate.c | 2+-
Msrc/common/tags.c | 2+-
Msrc/common/template.c | 2+-
Msrc/common/utils.c | 2+-
Msrc/compose.c | 2+-
Msrc/etpan/imap-thread.c | 2+-
Msrc/exporthtml.c | 2+-
Msrc/exportldif.c | 2+-
Msrc/ldapquery.c | 2+-
Msrc/main.c | 2+-
Msrc/mbox.c | 2+-
Msrc/messageview.c | 2+-
Msrc/mh.c | 2+-
Msrc/msgcache.c | 2+-
Msrc/news.c | 2+-
Msrc/partial_download.c | 2+-
Msrc/plugins/acpi_notifier/acpi_notifier.c | 2+-
Msrc/plugins/bogofilter/bogofilter.c | 2+-
Msrc/plugins/fancy/fancy_viewer.c | 2+-
Msrc/plugins/libravatar/libravatar_image.c | 2+-
Msrc/plugins/libravatar/libravatar_missing.c | 2+-
Msrc/plugins/mailmbox/mailmbox_folder.c | 2+-
Msrc/plugins/pgpinline/pgpinline.c | 2+-
Msrc/plugins/pgpmime/pgpmime.c | 2+-
Msrc/plugins/rssyl/opml_export.c | 2+-
Msrc/plugins/rssyl/rssyl_add_item.c | 2+-
Msrc/plugins/rssyl/rssyl_deleted.c | 2+-
Msrc/plugins/smime/smime.c | 2+-
Msrc/plugins/vcalendar/vcal_meeting_gtk.c | 2+-
Msrc/pop.c | 2+-
Msrc/prefs_common.c | 2+-
Msrc/procmsg.c | 2+-
Dsrc/safe_fclose.c | 46----------------------------------------------
Dsrc/safe_fclose.h | 24------------------------
42 files changed, 109 insertions(+), 109 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am @@ -228,7 +228,6 @@ claws_mail_SOURCES = \ quote_fmt_parse.y \ recv.c \ remotefolder.c \ - safe_fclose.c \ send_message.c \ setup.c \ sourcewindow.c \ @@ -349,7 +348,6 @@ claws_mailinclude_HEADERS = \ quote_fmt_parse.h \ recv.h \ remotefolder.h \ - safe_fclose.h \ send_message.h \ setup.h \ sourcewindow.h \ diff --git a/src/addrbook.c b/src/addrbook.c @@ -33,7 +33,7 @@ #include "addrcache.h" #include "addrbook.h" #include "adbookbase.h" -#include "safe_fclose.h" +#include "claws_io.h" #ifndef DEV_STANDALONE #include "prefs_gtk.h" diff --git a/src/addrindex.c b/src/addrindex.c @@ -43,7 +43,7 @@ #include "utils.h" #include "alertpanel.h" #include "passwordstore.h" -#include "safe_fclose.h" +#include "claws_io.h" #ifndef DEV_STANDALONE #include "prefs_gtk.h" diff --git a/src/common/Makefile.am b/src/common/Makefile.am @@ -43,6 +43,7 @@ libclawscommon_la_SOURCES = $(arch_sources) \ string_match.c \ stringtable.c \ claws.c \ + claws_io.c \ tags.c \ template.c \ utils.c \ @@ -74,6 +75,7 @@ clawscommoninclude_HEADERS = $(arch_headers) \ string_match.h \ stringtable.h \ claws.h \ + claws_io.h \ tags.h \ template.h \ timing.h \ @@ -87,7 +89,6 @@ clawscommoninclude_HEADERS = $(arch_headers) \ unmime.h AM_CPPFLAGS = \ - -I$(srcdir)/.. \ -I$(top_srcdir)/intl \ $(GLIB_CFLAGS) \ $(VALGRIND_CFLAGS) \ diff --git a/src/common/claws_io.c b/src/common/claws_io.c @@ -0,0 +1,47 @@ +/* + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 1999-2018 Colin Leroy and the Claws Mail team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#include "claws-features.h" +#endif + +#include <stdio.h> +#include <unistd.h> + +#include "timing.h" + +gboolean prefs_common_get_flush_metadata(void); + +int safe_fclose(FILE *fp) +{ + int r; + START_TIMING(""); + + if (fflush(fp) != 0) { + return EOF; + } + if (prefs_common_get_flush_metadata() && fsync(fileno(fp)) != 0) { + return EOF; + } + + r = fclose(fp); + END_TIMING(); + + return r; +} diff --git a/src/common/claws_io.h b/src/common/claws_io.h @@ -0,0 +1,24 @@ +/* + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 1999-2018 Colin Leroy and the Claws Mail team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __CLAWS_IO_H__ +#define __CLAWS_IO_H__ + +int safe_fclose(FILE *fp); + +#endif diff --git a/src/common/log.c b/src/common/log.c @@ -35,7 +35,7 @@ #include "utils.h" #include "log.h" #include "hooks.h" -#include "safe_fclose.h" +#include "claws_io.h" #define FWRITE(_b,_s,_n,_f) if (fwrite(_b,_s,_n,_f) != _n) { \ g_message("log fwrite failed!\n"); \ diff --git a/src/common/prefs.c b/src/common/prefs.c @@ -28,7 +28,7 @@ #include "prefs.h" #include "utils.h" -#include "safe_fclose.h" +#include "claws_io.h" static gboolean prefs_is_readonly (const gchar *path); diff --git a/src/common/ssl_certificate.c b/src/common/ssl_certificate.c @@ -46,7 +46,7 @@ #include "socket.h" #include "hooks.h" #include "defs.h" -#include "safe_fclose.h" +#include "claws_io.h" static GHashTable *warned_expired = NULL; diff --git a/src/common/tags.c b/src/common/tags.c @@ -40,7 +40,7 @@ #include "defs.h" #include "utils.h" #include "tags.h" -#include "safe_fclose.h" +#include "claws_io.h" static GHashTable *tags_table = NULL; static GHashTable *tags_reverse_table = NULL; diff --git a/src/common/template.c b/src/common/template.c @@ -29,7 +29,7 @@ #include "utils.h" #include "template.h" #include "codeconv.h" -#include "safe_fclose.h" +#include "claws_io.h" static GSList *template_list; diff --git a/src/common/utils.c b/src/common/utils.c @@ -86,7 +86,7 @@ #include "codeconv.h" #include "tlds.h" #include "timing.h" -#include "safe_fclose.h" +#include "claws_io.h" #define BUFFSIZE 8192 diff --git a/src/compose.c b/src/compose.c @@ -110,7 +110,7 @@ #include "autofaces.h" #include "spell_entry.h" #include "headers.h" -#include "safe_fclose.h" +#include "claws_io.h" #ifdef USE_LDAP #include "password.h" diff --git a/src/etpan/imap-thread.c b/src/etpan/imap-thread.c @@ -44,7 +44,7 @@ #include "utils.h" #include "mainwindow.h" #include "proxy.h" -#include "safe_fclose.h" +#include "claws_io.h" #include "ssl.h" #include "ssl_certificate.h" #include "socket.h" diff --git a/src/exporthtml.c b/src/exporthtml.c @@ -46,7 +46,7 @@ #include "utils.h" #include "exporthtml.h" #include "xmlprops.h" -#include "safe_fclose.h" +#include "claws_io.h" #ifdef MKDIR_TAKES_ONE_ARG #undef mkdir diff --git a/src/exportldif.c b/src/exportldif.c @@ -38,7 +38,7 @@ #include "exportldif.h" #include "xmlprops.h" #include "ldif.h" -#include "safe_fclose.h" +#include "claws_io.h" #ifdef MKDIR_TAKES_ONE_ARG diff --git a/src/ldapquery.c b/src/ldapquery.c @@ -38,7 +38,7 @@ #include "ldapctrl.h" #include "ldapserver.h" #include "mgutils.h" -#include "safe_fclose.h" +#include "claws_io.h" #include "addritem.h" #include "addrcache.h" diff --git a/src/main.c b/src/main.c @@ -132,7 +132,7 @@ #include "advsearch.h" #include "avatars.h" #include "passwordstore.h" -#include "safe_fclose.h" +#include "claws_io.h" #ifdef HAVE_LIBETPAN #include "imap-thread.h" diff --git a/src/mbox.c b/src/mbox.c @@ -56,7 +56,7 @@ #include "filtering.h" #include "alertpanel.h" #include "statusbar.h" -#include "safe_fclose.h" +#include "claws_io.h" #define MESSAGEBUFSIZE 8192 diff --git a/src/messageview.c b/src/messageview.c @@ -67,7 +67,7 @@ #include "statusbar.h" #include "folder_item_prefs.h" #include "avatars.h" -#include "safe_fclose.h" +#include "claws_io.h" #ifndef USE_ALT_ADDRBOOK #include "addressbook.h" diff --git a/src/mh.c b/src/mh.c @@ -44,7 +44,7 @@ #include "gtkutils.h" #include "timing.h" #include "msgcache.h" -#include "safe_fclose.h" +#include "claws_io.h" /* Define possible missing constants for Windows. */ #ifdef G_OS_WIN32 diff --git a/src/msgcache.c b/src/msgcache.c @@ -47,7 +47,7 @@ #include "timing.h" #include "tags.h" #include "prefs_common.h" -#include "safe_fclose.h" +#include "claws_io.h" #ifdef HAVE_FWRITE_UNLOCKED #define SC_FWRITE fwrite_unlocked diff --git a/src/news.c b/src/news.c @@ -62,7 +62,7 @@ # include "ssl.h" #endif #include "main.h" -#include "safe_fclose.h" +#include "claws_io.h" #define NNTP_PORT 119 #ifdef USE_GNUTLS diff --git a/src/partial_download.c b/src/partial_download.c @@ -63,7 +63,7 @@ #include "folder.h" #include "procheader.h" #include "msgcache.h" -#include "safe_fclose.h" +#include "claws_io.h" int partial_msg_in_uidl_list(MsgInfo *msginfo) { diff --git a/src/plugins/acpi_notifier/acpi_notifier.c b/src/plugins/acpi_notifier/acpi_notifier.c @@ -48,7 +48,7 @@ #include "folder_item_prefs.h" #include "gtk/gtkutils.h" #include "gtk/combobox.h" -#include "safe_fclose.h" +#include "claws_io.h" #define PREFS_BLOCK_NAME "AcpiNotifier" #define PLUGIN_NAME _("Acpi Notifier") diff --git a/src/plugins/bogofilter/bogofilter.c b/src/plugins/bogofilter/bogofilter.c @@ -52,7 +52,7 @@ #include "prefs_common.h" #include "alertpanel.h" #include "addr_compl.h" -#include "safe_fclose.h" +#include "claws_io.h" #ifdef HAVE_SYSEXITS_H #include <sysexits.h> diff --git a/src/plugins/fancy/fancy_viewer.c b/src/plugins/fancy/fancy_viewer.c @@ -28,7 +28,7 @@ #include <fancy_viewer.h> #include <fancy_prefs.h> #include <alertpanel.h> -#include <safe_fclose.h> +#include <claws_io.h> #include <printing.h> #include <webkit/webkithittestresult.h> diff --git a/src/plugins/libravatar/libravatar_image.c b/src/plugins/libravatar/libravatar_image.c @@ -27,7 +27,7 @@ #include <common/claws.h> #include <prefs_common.h> -#include <safe_fclose.h> +#include <claws_io.h> #include "libravatar.h" #include "libravatar_prefs.h" diff --git a/src/plugins/libravatar/libravatar_missing.c b/src/plugins/libravatar/libravatar_missing.c @@ -21,7 +21,7 @@ #include "libravatar_missing.h" #include "libravatar_prefs.h" #include "utils.h" -#include "safe_fclose.h" +#include "claws_io.h" /** * Loads the hash table of md5sum → time from the given filename. diff --git a/src/plugins/mailmbox/mailmbox_folder.c b/src/plugins/mailmbox/mailmbox_folder.c @@ -56,7 +56,7 @@ #include "mailmbox.h" #include "mailmbox_folder.h" #include "mailmbox_parse.h" -#include "safe_fclose.h" +#include "claws_io.h" #define MAILMBOX_CACHE_DIR "mailmboxcache" diff --git a/src/plugins/pgpinline/pgpinline.c b/src/plugins/pgpinline/pgpinline.c @@ -28,7 +28,7 @@ #include <glib/gi18n.h> #include <errno.h> #include <gpgme.h> -#include <safe_fclose.h> +#include <claws_io.h> #include "utils.h" #include "privacy.h" diff --git a/src/plugins/pgpmime/pgpmime.c b/src/plugins/pgpmime/pgpmime.c @@ -42,7 +42,7 @@ #include <plugins/pgpcore/pgp_utils.h> #include "prefs_common.h" -#include "safe_fclose.h" +#include "claws_io.h" typedef struct _PrivacyDataPGP PrivacyDataPGP; diff --git a/src/plugins/rssyl/opml_export.c b/src/plugins/rssyl/opml_export.c @@ -32,7 +32,7 @@ #include <log.h> #include <folder.h> #include <common/utils.h> -#include <safe_fclose.h> +#include <claws_io.h> /* Local includes */ #include "libfeed/date.h" diff --git a/src/plugins/rssyl/rssyl_add_item.c b/src/plugins/rssyl/rssyl_add_item.c @@ -34,7 +34,7 @@ #include <codeconv.h> #include <procmsg.h> #include <common/utils.h> -#include <safe_fclose.h> +#include <claws_io.h> /* Local includes */ #include "libfeed/date.h" diff --git a/src/plugins/rssyl/rssyl_deleted.c b/src/plugins/rssyl/rssyl_deleted.c @@ -31,7 +31,7 @@ /* Claws Mail includes */ #include <codeconv.h> #include <common/utils.h> -#include <safe_fclose.h> +#include <claws_io.h> /* Local includes */ #include "rssyl.h" diff --git a/src/plugins/smime/smime.c b/src/plugins/smime/smime.c @@ -43,7 +43,7 @@ #include "prefs_common.h" #include "procmime.h" #include "plugin.h" -#include "safe_fclose.h" +#include "claws_io.h" typedef struct _PrivacyDataPGP PrivacyDataPGP; diff --git a/src/plugins/vcalendar/vcal_meeting_gtk.c b/src/plugins/vcalendar/vcal_meeting_gtk.c @@ -54,7 +54,7 @@ #include "gtkutils.h" #include "log.h" #include "utils.h" -#include "safe_fclose.h" +#include "claws_io.h" struct _VCalMeeting { diff --git a/src/pop.c b/src/pop.c @@ -40,7 +40,7 @@ #include "partial_download.h" #include "log.h" #include "hooks.h" -#include "safe_fclose.h" +#include "claws_io.h" static gint pop3_greeting_recv (Pop3Session *session, const gchar *msg); diff --git a/src/prefs_common.c b/src/prefs_common.c @@ -61,7 +61,7 @@ #include "prefswindow.h" #include "colorlabel.h" #include "passwordstore.h" -#include "safe_fclose.h" +#include "claws_io.h" #ifndef USE_ALT_ADDRBOOK #include "addrcustomattr.h" diff --git a/src/procmsg.c b/src/procmsg.c @@ -49,7 +49,7 @@ #include "timing.h" #include "inc.h" #include "privacy.h" -#include "safe_fclose.h" +#include "claws_io.h" extern SessionStats session_stats; diff --git a/src/safe_fclose.c b/src/safe_fclose.c @@ -1,46 +0,0 @@ -/* - * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2018 Colin Leroy and the Claws Mail team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#include "claws-features.h" -#endif - -#include <stdio.h> -#include <unistd.h> - -#include "prefs_common.h" -#include "common/timing.h" - -int safe_fclose(FILE *fp) -{ - int r; - START_TIMING(""); - - if (fflush(fp) != 0) { - return EOF; - } - if (prefs_common_get_prefs()->flush_metadata && fsync(fileno(fp)) != 0) { - return EOF; - } - - r = fclose(fp); - END_TIMING(); - - return r; -} diff --git a/src/safe_fclose.h b/src/safe_fclose.h @@ -1,24 +0,0 @@ -/* - * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2018 Colin Leroy and the Claws Mail team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef __SAFE_FCLOSE_H__ -#define __SAFE_FCLOSE_H__ - -int safe_fclose(FILE *fp); - -#endif