preference for every data file we write into.
quote_fmt_parse.y \
recv.c \
remotefolder.c \
+ safe_fclose.c \
send_message.c \
setup.c \
sourcewindow.c \
quote_fmt_parse.h \
recv.h \
remotefolder.h \
+ safe_fclose.h \
send_message.h \
setup.h \
sourcewindow.h \
#include "addrcache.h"
#include "addrbook.h"
#include "adbookbase.h"
+#include "safe_fclose.h"
#ifndef DEV_STANDALONE
#include "prefs_gtk.h"
book->retVal = MGU_SUCCESS;
#ifdef DEV_STANDALONE
- fclose(fp);
+ safe_fclose(fp);
#else
if (prefs_file_close( pfile ) < 0)
book->retVal = MGU_ERROR_WRITE;
#include "utils.h"
#include "alertpanel.h"
#include "passwordstore.h"
+#include "safe_fclose.h"
#ifndef DEV_STANDALONE
#include "prefs_gtk.h"
addrIndex->retVal = MGU_SUCCESS;
#ifdef DEV_STANDALONE
- fclose( fp );
+ safe_fclose( fp );
#else
if( prefs_file_close( pfile ) < 0 ) {
addrIndex->retVal = MGU_ERROR_WRITE;
unmime.h
AM_CPPFLAGS = \
+ -I$(srcdir)/.. \
-I$(top_srcdir)/intl \
$(GLIB_CFLAGS) \
$(VALGRIND_CFLAGS) \
#include "utils.h"
#include "log.h"
#include "hooks.h"
+#include "safe_fclose.h"
#define FWRITE(_b,_s,_n,_f) if (fwrite(_b,_s,_n,_f) != _n) { \
g_message("log fwrite failed!\n"); \
void close_log_file(LogInstance instance)
{
if (log_fp[instance]) {
- fclose(log_fp[instance]);
+ safe_fclose(log_fp[instance]);
log_fp[instance] = NULL;
log_size[instance] = 0;
g_free(log_filename[instance]);
#include "prefs.h"
#include "utils.h"
+#include "safe_fclose.h"
static gboolean prefs_is_readonly (const gchar *path);
tmppath = g_strconcat(path, ".tmp", NULL);
-
- if (prefs_common_get_flush_metadata() && fsync(fileno(fp)) < 0) {
- FILE_OP_ERROR(tmppath, "fsync");
- fclose(fp);
- claws_unlink(tmppath);
- g_free(path);
- g_free(tmppath);
- return -1;
- }
-
- if (fclose(fp) == EOF) {
+ if (safe_fclose(fp) == EOF) {
FILE_OP_ERROR(tmppath, "fclose");
claws_unlink(tmppath);
g_free(path);
#include "socket.h"
#include "hooks.h"
#include "defs.h"
+#include "safe_fclose.h"
static GHashTable *warned_expired = NULL;
gnutls_export_X509_fp(fp, cert->x509_cert, GNUTLS_X509_FMT_DER);
g_free(file);
- fclose(fp);
+ safe_fclose(fp);
}
}
if (fp)
- fclose(fp);
+ safe_fclose(fp);
}
gboolean ssl_certificate_check (gnutls_x509_crt_t x509_cert, guint status,
#include "defs.h"
#include "utils.h"
#include "tags.h"
+#include "safe_fclose.h"
static GHashTable *tags_table = NULL;
static GHashTable *tags_reverse_table = NULL;
return;
}
- if (fclose(fp) == EOF) {
+ if (safe_fclose(fp) == EOF) {
FILE_OP_ERROR(file, "fclose");
g_free(file);
g_free(file_new);
#include "utils.h"
#include "template.h"
#include "codeconv.h"
+#include "safe_fclose.h"
static GSList *template_list;
} else {
TRY(fwrite("", sizeof(gchar), 1, fp) == 1);
}
- TRY_NO_CLOSE(fclose(fp) != EOF);
+ TRY_NO_CLOSE(safe_fclose(fp) != EOF);
if (new) {
if (rename_force(new, filename) < 0) {
#include "socket.h"
#include "codeconv.h"
#include "tlds.h"
+#include "timing.h"
+#include "safe_fclose.h"
#define BUFFSIZE 8192
}
fclose(fp);
- if (fclose(outfp) == EOF) {
+ if (safe_fclose(outfp) == EOF) {
goto unlinkout;
}
err = TRUE;
}
fclose(src_fp);
- if (fclose(dest_fp) == EOF) {
+ if (safe_fclose(dest_fp) == EOF) {
FILE_OP_ERROR(dest, "fclose");
err = TRUE;
}
if (copy_file_part_to_fp(fp, offset, length, dest_fp) < 0)
err = TRUE;
- if (fclose(dest_fp) == EOF) {
+ if (safe_fclose(dest_fp) == EOF) {
FILE_OP_ERROR(dest, "fclose");
err = TRUE;
}
err = TRUE;
}
fclose(src_fp);
- if (fclose(dest_fp) == EOF) {
+ if (safe_fclose(dest_fp) == EOF) {
FILE_OP_ERROR(dest, "fclose");
err = TRUE;
}
return -1;
}
- if (fclose(fp) == EOF) {
+ if (safe_fclose(fp) == EOF) {
FILE_OP_ERROR(file, "fclose");
claws_unlink(file);
return -1;
if (fp)
fclose(fp);
- if (fclose(outfp) == EOF)
+ if (safe_fclose(outfp) == EOF)
err = TRUE;
if (!err)
#include "autofaces.h"
#include "spell_entry.h"
#include "headers.h"
+#include "safe_fclose.h"
+
#ifdef USE_LDAP
#include "password.h"
#include "ldapserver.h"
g_free(chars);
- if (fclose(fp) == EOF) {
+ if (safe_fclose(fp) == EOF) {
FILE_OP_ERROR(file, "fclose");
claws_unlink(file);
return -1;
g_free(tmp);
return COMPOSE_QUEUE_ERROR_WITH_ERRNO;
}
- if (fclose(fp) == EOF) {
+ if (safe_fclose(fp) == EOF) {
FILE_OP_ERROR(tmp, "fclose");
claws_unlink(tmp);
g_free(tmp);
fclose(fp);
goto warn_err;
}
- if (fclose(fp) == EOF) {
+ if (safe_fclose(fp) == EOF) {
goto warn_err;
}
#include "utils.h"
#include "mainwindow.h"
#include "proxy.h"
+#include "safe_fclose.h"
#include "ssl.h"
#include "ssl_certificate.h"
#include "socket.h"
goto fclose;
}
- r = fclose(f);
+ r = safe_fclose(f);
if (r == EOF) {
result->error = MAILIMAP_ERROR_FETCH;
goto unlink;
#include "utils.h"
#include "exporthtml.h"
#include "xmlprops.h"
+#include "safe_fclose.h"
#ifdef MKDIR_TAKES_ONE_ARG
#undef mkdir
fprintf( cssFile, ".tab-attr {\n" );
fprintf( cssFile, "}\n" );
- fclose( cssFile );
+ safe_fclose( cssFile );
return MGU_SUCCESS;
}
fprintf( cssFile, ".tab-attr {\n" );
fprintf( cssFile, "}\n" );
- fclose( cssFile );
+ safe_fclose( cssFile );
return MGU_SUCCESS;
}
fprintf( htmlFile, "</body>\n" );
fprintf( htmlFile, "</html>\n" );
- fclose( htmlFile );
+ safe_fclose( htmlFile );
ctl->retVal = MGU_SUCCESS;
/* Create stylesheet files */
#include "exportldif.h"
#include "xmlprops.h"
#include "ldif.h"
+#include "safe_fclose.h"
#ifdef MKDIR_TAKES_ONE_ARG
rootFolder = cache->rootFolder;
exportldif_fmt_folder( ctl, ldifFile, rootFolder );
- fclose( ldifFile );
+ safe_fclose( ldifFile );
ctl->retVal = MGU_SUCCESS;
}
#include "ldapctrl.h"
#include "ldapserver.h"
#include "mgutils.h"
+#include "safe_fclose.h"
#include "addritem.h"
#include "addrcache.h"
FILE *fp = g_fopen(file, "wb");
if (fp) {
fwrite(vals[0]->bv_val, 1, vals[0]->bv_len, fp);
- fclose(fp);
+ safe_fclose(fp);
}
list = g_slist_append( list, file);
}
#include "advsearch.h"
#include "avatars.h"
#include "passwordstore.h"
+#include "safe_fclose.h"
#ifdef HAVE_LIBETPAN
#include "imap-thread.h"
g_free(new_plugin_path);
g_free(old_plugin_path);
fclose(oldfp);
- if (fclose(newfp) == EOF)
+ if (safe_fclose(newfp) == EOF)
err = TRUE;
return (err ? -1:0);
#include "filtering.h"
#include "alertpanel.h"
#include "statusbar.h"
+#include "safe_fclose.h"
#define MESSAGEBUFSIZE 8192
return -1;
}
- if (fclose(tmp_fp) == EOF) {
+ if (safe_fclose(tmp_fp) == EOF) {
FILE_OP_ERROR(tmp_file, "fclose");
g_warning("can't write to temporary file");
fclose(mbox_fp);
return -1;
}
- if (fclose(lockfp) == EOF) {
+ if (safe_fclose(lockfp) == EOF) {
FILE_OP_ERROR(lockfile, "fclose");
g_free(lockfile);
return -1;
err = TRUE;
}
- if (fclose(dest_fp) == EOF) {
+ if (safe_fclose(dest_fp) == EOF) {
FILE_OP_ERROR(dest, "fclose");
err = TRUE;
}
g_warning("can't truncate mailbox to zero.");
return;
}
- fclose(fp);
+ safe_fclose(fp);
}
gint export_list_to_mbox(GSList *mlist, const gchar *mbox)
#ifdef HAVE_FGETS_UNLOCKED
funlockfile(msg_fp);
#endif
- fclose(msg_fp);
+ safe_fclose(msg_fp);
statusbar_progress_all(msgs++,total, 500);
if (msgs%500 == 0)
GTK_EVENTS_FLUSH();
#ifdef HAVE_FGETS_UNLOCKED
funlockfile(mbox_fp);
#endif
- fclose(mbox_fp);
+ safe_fclose(mbox_fp);
return err;
}
#include "statusbar.h"
#include "folder_item_prefs.h"
#include "avatars.h"
+#include "safe_fclose.h"
+
#ifndef USE_ALT_ADDRBOOK
#include "addressbook.h"
#else
if (ok < 0)
goto FILE_ERROR;
- if (fclose(fp) == EOF) {
+ if (safe_fclose(fp) == EOF) {
FILE_OP_ERROR(tmp, "fclose");
claws_unlink(tmp);
return -1;
#include "gtkutils.h"
#include "timing.h"
#include "msgcache.h"
+#include "safe_fclose.h"
/* Define possible missing constants for Windows. */
#ifdef G_OS_WIN32
fclose(mh_sequences_old_fp);
}
- fflush(mh_sequences_new_fp);
-#if 0
- fsync(fileno(mh_sequences_new_fp));
-#endif
- if (fclose(mh_sequences_new_fp) == EOF)
+ if (safe_fclose(mh_sequences_new_fp) == EOF)
err = TRUE;
if (!err) {
#include "timing.h"
#include "tags.h"
#include "prefs_common.h"
+#include "safe_fclose.h"
#ifdef HAVE_FWRITE_UNLOCKED
#define SC_FWRITE fwrite_unlocked
if (write_fps.tags_fp)
funlockfile(write_fps.tags_fp);
#endif
- /* flush buffers */
- if (write_fps.cache_fp)
- write_fps.error |= (fflush(write_fps.cache_fp) != 0);
- if (write_fps.mark_fp)
- write_fps.error |= (fflush(write_fps.mark_fp) != 0);
- if (write_fps.tags_fp)
- write_fps.error |= (fflush(write_fps.tags_fp) != 0);
-
- /* sync to filesystem */
- if (prefs_common.flush_metadata && write_fps.cache_fp)
- write_fps.error |= (fsync(fileno(write_fps.cache_fp)) != 0);
- if (prefs_common.flush_metadata && write_fps.mark_fp)
- write_fps.error |= (fsync(fileno(write_fps.mark_fp)) != 0);
- if (prefs_common.flush_metadata && write_fps.tags_fp)
- write_fps.error |= (fsync(fileno(write_fps.tags_fp)) != 0);
/* close files */
if (write_fps.cache_fp)
- write_fps.error |= (fclose(write_fps.cache_fp) != 0);
+ write_fps.error |= (safe_fclose(write_fps.cache_fp) != 0);
if (write_fps.mark_fp)
- write_fps.error |= (fclose(write_fps.mark_fp) != 0);
+ write_fps.error |= (safe_fclose(write_fps.mark_fp) != 0);
if (write_fps.tags_fp)
- write_fps.error |= (fclose(write_fps.tags_fp) != 0);
+ write_fps.error |= (safe_fclose(write_fps.tags_fp) != 0);
if (write_fps.error != 0) {
# include "ssl.h"
#endif
#include "main.h"
+#include "safe_fclose.h"
#define NNTP_PORT 119
#ifdef USE_GNUTLS
}
newsnntp_list_free(grouplist);
}
- if (fclose(fp) == EOF) {
+ if (safe_fclose(fp) == EOF) {
log_error(LOG_PROTOCOL, ("Can't write newsgroup list\n"));
session_destroy(SESSION(session));
REMOTE_FOLDER(folder)->session = NULL;
return -1;
}
- if (fclose(tmpfp) == EOF) {
+ if (safe_fclose(tmpfp) == EOF) {
FILE_OP_ERROR(tmp, "fclose");
claws_unlink(tmp);
g_free(tmp);
#include "folder.h"
#include "procheader.h"
#include "msgcache.h"
+#include "safe_fclose.h"
int partial_msg_in_uidl_list(MsgInfo *msginfo)
{
g_free(stat);
}
}
- if (fclose(fpnew) == EOF) {
+ if (safe_fclose(fpnew) == EOF) {
FILE_OP_ERROR(pathnew, "fclose");
fclose(fp);
g_free(path);
goto bail;
}
}
- if (fclose(fpnew) == EOF) {
+ if (safe_fclose(fpnew) == EOF) {
FILE_OP_ERROR(pathnew, "fclose");
fclose(fp);
g_free(pathnew);
#include "folder_item_prefs.h"
#include "gtk/gtkutils.h"
#include "gtk/combobox.h"
+#include "safe_fclose.h"
#define PREFS_BLOCK_NAME "AcpiNotifier"
#define PLUGIN_NAME _("Acpi Notifier")
} else {
fwrite(acpiprefs.off_param, 1, strlen(acpiprefs.off_param), fp);
}
- fclose(fp);
+ safe_fclose(fp);
} else {
gchar *cmd = g_strdup_printf("%s %s",
acpiprefs.file_path,
#include "prefs_common.h"
#include "alertpanel.h"
#include "addr_compl.h"
+#include "safe_fclose.h"
#ifdef HAVE_SYSEXITS_H
#include <sysexits.h>
}
}
fclose(input);
- if (fclose(output) == EOF)
+ if (safe_fclose(output) == EOF)
err = TRUE;
if (!err)
move_file(tmpfile, file, TRUE);
procmsg_register_spam_learner
procmsg_spam_set_folder
procmsg_unregister_spam_learner
+safe_fclose
settings
start_address_completion
statusbar_pop_all
#include <fancy_viewer.h>
#include <fancy_prefs.h>
#include <alertpanel.h>
+#include <safe_fclose.h>
#include <printing.h>
#include <webkit/webkithittestresult.h>
if (CURLE_OK != res)
alertpanel_error(_("An error occurred: %d\n"), res);
if (viewer->stream)
- fclose(viewer->stream);
+ safe_fclose(viewer->stream);
curl_global_cleanup();
}
#ifdef USE_PTHREAD
prefs_common_get_prefs
procmsg_msginfo_add_avatar
procmsg_msginfo_get_avatar
+safe_fclose
slist_free_strings_full
to_human_readable
#include <common/claws.h>
#include <prefs_common.h>
+#include <safe_fclose.h>
#include "libravatar.h"
#include "libravatar_prefs.h"
debug_print("retrieving URL to file: %s -> %s\n", url, filename);
curl_easy_perform(curl);
filesize = ftell(file);
- fclose(file);
+ safe_fclose(file);
if (filesize < MIN_PNG_SIZE)
debug_print("not enough data for an avatar image: %ld bytes\n", filesize);
else
#include "libravatar_missing.h"
#include "libravatar_prefs.h"
#include "utils.h"
+#include "safe_fclose.h"
/**
* Loads the hash table of md5sum → time from the given filename.
g_hash_table_foreach(table, missing_save_item, (gpointer)file);
debug_print("Saved %u missing avatar entries\n", g_hash_table_size(table));
- if (fclose(file) != 0) {
+ if (safe_fclose(file) != 0) {
g_warning("error closing '%s'", filename);
return -1;
}
prefs_write_open
prefs_write_param
prefs_common_get_prefs
+safe_fclose
\ No newline at end of file
#include "mailmbox.h"
#include "mailmbox_folder.h"
#include "mailmbox_parse.h"
+#include "safe_fclose.h"
#define MAILMBOX_CACHE_DIR "mailmboxcache"
return;
}
- fclose(f);
+ safe_fclose(f);
}
static void claws_mailmbox_folder_item_destroy(Folder *folder, FolderItem *_item)
if (r == 0)
goto close;
- fclose(f);
+ safe_fclose(f);
return file;
procmime_write_mimeinfo
procmime_get_part
procmime_get_tmp_file_name
+safe_fclose
\ No newline at end of file
#include <glib/gi18n.h>
#include <errno.h>
#include <gpgme.h>
+#include <safe_fclose.h>
#include "utils.h"
#include "privacy.h"
}
}
- if (fclose(dstfp) == EOF) {
+ if (safe_fclose(dstfp) == EOF) {
FILE_OP_ERROR(fname, "fclose");
privacy_set_error(_("Couldn't close decrypted file %s"), fname);
g_free(fname);
procmime_mimeinfo_parent
procmime_scan_file
procmime_write_mimeinfo
+safe_fclose
\ No newline at end of file
#include <plugins/pgpcore/pgp_utils.h>
#include "prefs_common.h"
+#include "safe_fclose.h"
typedef struct _PrivacyDataPGP PrivacyDataPGP;
}
g_free(chars);
- if (fclose(dstfp) == EOF) {
+ if (safe_fclose(dstfp) == EOF) {
FILE_OP_ERROR(fname, "fclose");
privacy_set_error(_("Couldn't close decrypted file %s"), fname);
g_free(fname);
procmsg_get_message_file
procmsg_msginfo_unset_flags
remove_dir_recursive
+safe_fclose
slist_free_strings_full
strtailchomp
subst_for_shellsafe_filename
#include <log.h>
#include <folder.h>
#include <common/utils.h>
+#include <safe_fclose.h>
/* Local includes */
#include "libfeed/date.h"
debug_print("RSSyl: Feed export finished.\n");
- fclose(f);
+ safe_fclose(f);
g_free(opmlfile);
g_free(ctx);
}
#include <codeconv.h>
#include <procmsg.h>
#include <common/utils.h>
+#include <safe_fclose.h>
/* Local includes */
#include "libfeed/date.h"
feed_item_enclosure_get_size(enc) );
fprintf(f, "</body></html>\n");
- fclose(f);
+ safe_fclose(f);
g_return_if_fail(template != NULL);
/* Claws Mail includes */
#include <codeconv.h>
#include <common/utils.h>
+#include <safe_fclose.h>
/* Local includes */
#include "rssyl.h"
g_slist_foreach(deleted_items, (GFunc)_store_one_deleted_item,
(gpointer)f);
- fclose(f);
+ safe_fclose(f);
debug_print("RSSyl: written and closed deletion file\n");
}
procmime_scan_file
procmime_write_mime_header
procmime_write_mimeinfo
+safe_fclose
str_write_to_file
#include "prefs_common.h"
#include "procmime.h"
#include "plugin.h"
+#include "safe_fclose.h"
typedef struct _PrivacyDataPGP PrivacyDataPGP;
return NULL;
}
}
- if (fclose(dstfp) == EOF) {
+ if (safe_fclose(dstfp) == EOF) {
FILE_OP_ERROR(fname, "fclose");
g_free(fname);
g_free(chars);
procmime_decode_content(msgcontent);
procmime_write_mime_header(msgcontent, fp);
procmime_write_mimeinfo(msgcontent, fp);
- fclose(fp);
+ safe_fclose(fp);
canonicalize_file_replace(tmpfile);
fp = g_fopen(tmpfile, "rb");
if (fp == NULL) {
g_free(enccontent);
return FALSE;
}
- if (fclose(fp) == EOF) {
+ if (safe_fclose(fp) == EOF) {
FILE_OP_ERROR(tmpfile, "fclose");
claws_unlink(tmpfile);
g_free(tmpfile);
procmsg_send_message_queue_with_lock
qp_encode_line
remove_dir_recursive
+safe_fclose
slist_free_strings
slist_free_strings_full
statusbar_progress_all
#include "gtkutils.h"
#include "log.h"
#include "utils.h"
+#include "safe_fclose.h"
struct _VCalMeeting
{
FILE_OP_ERROR(file, "fprintf");
g_free(file);
}
- if (fclose(fp) == EOF)
+ if (safe_fclose(fp) == EOF)
FILE_OP_ERROR(file, "fclose");
} else {
FILE_OP_ERROR(file, "fopen");
#include "partial_download.h"
#include "log.h"
#include "hooks.h"
+#include "safe_fclose.h"
static gint pop3_greeting_recv (Pop3Session *session,
const gchar *msg);
> 0);
}
- if (fclose(fp) == EOF) {
+ if (safe_fclose(fp) == EOF) {
FILE_OP_ERROR(tmp_path, "fclose");
fp = NULL;
goto err_write;
}
}
- if (fclose(fp) == EOF) {
+ if (safe_fclose(fp) == EOF) {
FILE_OP_ERROR(file, "fclose");
claws_unlink(file);
return -1;
#include "prefswindow.h"
#include "colorlabel.h"
#include "passwordstore.h"
+#include "safe_fclose.h"
+
#ifndef USE_ALT_ADDRBOOK
#include "addrcustomattr.h"
#endif
fputc('\n', fp) != EOF);
}
- if (fclose(fp) == EOF) {
+ if (safe_fclose(fp) == EOF) {
FILE_OP_ERROR(tmp_path, "fclose");
fp = NULL;
goto out;
out:
if (fp)
- fclose(fp);
+ safe_fclose(fp);
g_free(tmp_path);
g_free(path);
}
#include "timing.h"
#include "inc.h"
#include "privacy.h"
+#include "safe_fclose.h"
extern SessionStats session_stats;
return -1;
}
}
- fclose(outfp);
+ safe_fclose(outfp);
fclose(fp);
return 0;
}
}
}
}
- fclose(tmpfp);
+ safe_fclose(tmpfp);
if (newsval == 0) {
debug_print("Sending message by news\n");
}
if (fp && procmime_write_mimeinfo(mimeinfo, fp) >= 0) {
- fclose(fp);
+ safe_fclose(fp);
fp = NULL;
tmp_msginfo = procheader_parse_file(
tmpfile, flags,
TRUE, FALSE);
}
if (fp)
- fclose(fp);
+ safe_fclose(fp);
if (tmp_msginfo != NULL) {
if (src_msginfo)
--- /dev/null
+/*
+ * 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;
+}
--- /dev/null
+/*
+ * 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