add markfile declaration to appropriate functions when fchmod is not available
[claws.git] / src / mh.c
index 4c860c60f3db52ae259a2020d5ec2ccfb43c6c57..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);
@@ -377,6 +373,8 @@ gint mh_copy_msg(Folder *folder, FolderItem *dest, MsgInfo *msginfo)
                                   dest->last_num + 1);
        g_free(destdir);
 
+       dest->op_count--;
+
        if (is_file_exist(destfile)) {
                g_warning(_("%s already exists."), destfile);
                g_free(srcfile);
@@ -424,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);
@@ -620,6 +620,8 @@ void mh_scan_folder(Folder *folder, FolderItem *item)
 
        g_return_if_fail(item != NULL);
 
+       debug_print("mh_scan_folder(): Scanning %s ...\n", item->path);
+
        path = folder_item_get_path(item);
        g_return_if_fail(path != NULL);
        if (change_dir(path) < 0) {