Skip to content

Commit

Permalink
Turn an assert into two more descriptive errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne Davison committed May 29, 2010
1 parent 86be7a0 commit c3541d3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit c3541d3

Please sign in to comment.