Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
86be7a0
)
Turn an assert into two more descriptive errors.
author
Wayne Davison
<wayned@samba.org>
Sat, 29 May 2010 15:52:59 +0000
(08:52 -0700)
committer
Wayne Davison
<wayned@samba.org>
Sat, 29 May 2010 15:52:59 +0000
(08:52 -0700)
hlink.c
patch
|
blob
|
blame
|
history
diff --git
a/hlink.c
b/hlink.c
index
dc969e9
..
9057a92
100644
(file)
--- 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);
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)))
assert(CVAL(node->data, 0) == 0);
free(node->data);
if (!(node->data = strdup(our_name)))