add markfile declaration to appropriate functions when fchmod is not available
[claws.git] / src / mh.c
index ae10a65efdf2040da41dcb96e526f4c53ae195d2..b9996810f6a34443649599d82f659862d2629ceb 100644 (file)
--- a/src/mh.c
+++ b/src/mh.c
@@ -153,15 +153,9 @@ gint mh_add_msg(Folder *folder, FolderItem *dest, const gchar *file,
                                   dest->last_num + 1);
 
        if (link(file, destfile) < 0) {
-               if (EXDEV == errno) {
-                       if (copy_file(file, destfile) < 0) {
-                               g_warning(_("can't copy message %s to %s\n"),
-                                         file, destfile);
-                               g_free(destfile);
-                               return -1;
-                       }
-               } else {
-                       FILE_OP_ERROR(file, "link");
+               if (copy_file(file, destfile) < 0) {
+                       g_warning(_("can't copy message %s to %s\n"),
+                                 file, destfile);
                        g_free(destfile);
                        return -1;
                }
@@ -252,6 +246,8 @@ gint mh_move_msg(Folder *folder, FolderItem *dest, MsgInfo *msginfo)
 #if HAVE_FCHMOD
                        fchmod(fileno(fp), filemode);
 #else
+                       gchar *markfile;
+
                        markfile = folder_item_get_mark_file(dest);
                        if (markfile) {
                                chmod(markfile, filemode);
@@ -426,6 +422,8 @@ gint mh_copy_msg(Folder *folder, FolderItem *dest, MsgInfo *msginfo)
 #if HAVE_FCHMOD
                        fchmod(fileno(fp), filemode);
 #else
+                       gchar *markfile;
+
                        markfile = folder_item_get_mark_file(dest);
                        if (markfile) {
                                chmod(markfile, filemode);