More tweaks for Actions.
[rsync.git] / hlink.c
diff --git a/hlink.c b/hlink.c
index 85f547043adce9fc976e78e7737946b2b0df1094..20291f2673fdb5af3731c077a978ca297c9e0f0a 100644 (file)
--- a/hlink.c
+++ b/hlink.c
@@ -4,7 +4,7 @@
  * Copyright (C) 1996 Andrew Tridgell
  * Copyright (C) 1996 Paul Mackerras
  * Copyright (C) 2002 Martin Pool <mbp@samba.org>
- * Copyright (C) 2004-2020 Wayne Davison
+ * Copyright (C) 2004-2022 Wayne Davison
  *
  * 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
@@ -125,8 +125,7 @@ static void match_gnums(int32 *ndx_list, int ndx_count)
                if (inc_recurse) {
                        node = hashtable_find(prior_hlinks, gnum, data_when_new);
                        if (node->data == data_when_new) {
-                               if (!(node->data = new_array0(char, 5)))
-                                       out_of_memory("match_gnums");
+                               node->data = new_array0(char, 5);
                                assert(gnum >= hlink_flist->ndx_start);
                                file->flags |= FLAG_HLINK_FIRST;
                                prev = -1;
@@ -190,8 +189,7 @@ void match_hard_links(struct file_list *flist)
                int i, ndx_count = 0;
                int32 *ndx_list;
 
-               if (!(ndx_list = new_array(int32, flist->used)))
-                       out_of_memory("match_hard_links");
+               ndx_list = new_array(int32, flist->used);
 
                for (i = 0; i < flist->used; i++) {
                        if (F_IS_HLINKED(flist->sorted[i]))
@@ -408,7 +406,7 @@ int hard_link_check(struct file_struct *file, int ndx, char *fname,
                                }
                                break;
                        }
-                       if (!unchanged_file(cmpbuf, file, &alt_sx.st))
+                       if (!quick_check_ok(FT_REG, cmpbuf, file, &alt_sx.st))
                                continue;
                        statret = 1;
                        if (unchanged_attrs(cmpbuf, file, &alt_sx))
@@ -448,7 +446,7 @@ int hard_link_check(struct file_struct *file, int ndx, char *fname,
                return -1;
 
        if (remove_source_files == 1 && do_xfers)
-               send_msg_int(MSG_SUCCESS, ndx);
+               send_msg_success(fname, ndx);
 
        return 1;
 }
@@ -521,7 +519,7 @@ void finish_hard_link(struct file_struct *file, const char *fname, int fin_ndx,
                if (val < 0)
                        continue;
                if (remove_source_files == 1 && do_xfers)
-                       send_msg_int(MSG_SUCCESS, ndx);
+                       send_msg_success(fname, ndx);
        }
 
        if (inc_recurse) {
@@ -541,8 +539,7 @@ void finish_hard_link(struct file_struct *file, const char *fname, int fin_ndx,
                        exit_cleanup(RERR_MESSAGEIO);
                }
                free(node->data);
-               if (!(node->data = strdup(our_name)))
-                       out_of_memory("finish_hard_link");
+               node->data = strdup(our_name);
        }
 }