summaryrefslogtreecommitdiff
path: root/hlink.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2010-05-29 08:52:59 -0700
committerWayne Davison <wayned@samba.org>2010-05-29 08:52:59 -0700
commitc3541d30b699f67764772caa3a6a17f81b2bf2f2 (patch)
tree77b8046c4eb72a14039d0b77a8d1e1af8e36d766 /hlink.c
parent86be7a0e647d1fbfd6b5ecf9d95163b8e07cf4c8 (diff)
downloadrsync-c3541d30b699f67764772caa3a6a17f81b2bf2f2.tar.gz
Turn an assert into two more descriptive errors.
Diffstat (limited to 'hlink.c')
-rw-r--r--hlink.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hlink.c b/hlink.c
index dc969e9a..9057a92d 100644
--- a/hlink.c
+++ b/hlink.c
@@ -543,7 +543,14 @@ void finish_hard_link(struct file_struct *file, const char *fname, int fin_ndx,
if (inc_recurse) {
int gnum = F_HL_GNUM(file);
struct ht_int32_node *node = hashtable_find(prior_hlinks, gnum, 0);
- assert(node != NULL && node->data != NULL);
+ if (node == NULL) {
+ rprintf(FERROR, "Unable to find a hlink node for %d (%s)\n", gnum, f_name(file, prev_name));
+ exit_cleanup(RERR_MESSAGEIO);
+ }
+ if (node->data == NULL) {
+ rprintf(FERROR, "Hlink node data for %d is NULL (%s)\n", gnum, f_name(file, prev_name));
+ exit_cleanup(RERR_MESSAGEIO);
+ }
assert(CVAL(node->data, 0) == 0);
free(node->data);
if (!(node->data = strdup(our_name)))