* Copyright (C) 1996 Andrew Tridgell
* Copyright (C) 1996 Paul Mackerras
* Copyright (C) 2002 Martin Pool <mbp@samba.org>
* Copyright (C) 1996 Andrew Tridgell
* Copyright (C) 1996 Paul Mackerras
* Copyright (C) 2002 Martin Pool <mbp@samba.org>
*
* 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
*
* 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
assert(gnum >= hlink_flist->ndx_start);
file->flags |= FLAG_HLINK_FIRST;
prev = -1;
} else if (CVAL(node->data, 0) == 0) {
struct file_list *flist;
prev = IVAL(node->data, 1);
assert(gnum >= hlink_flist->ndx_start);
file->flags |= FLAG_HLINK_FIRST;
prev = -1;
} else if (CVAL(node->data, 0) == 0) {
struct file_list *flist;
prev = IVAL(node->data, 1);
- if (prev_ndx < 0) {
- *prev_ndx_p = prev_ndx;
- *flist_p = NULL;
- return NULL;
- }
- if ((flist = flist_for_ndx(prev_ndx)) == NULL)
+ struct file_list *flist;
+ if (prev_ndx < 0
+ || (flist = flist_for_ndx(prev_ndx, NULL)) == NULL)
- node = hashtable_find(prior_hlinks, gnum, 0);
- assert(node != NULL && node->data);
-
- if (CVAL(node->data, 0) == 0) {
+ if (inc_recurse
+ && (node = hashtable_find(prior_hlinks, gnum, 0)) != NULL) {
+ assert(node->data != NULL);
+ if (CVAL(node->data, 0) != 0) {
+ *prev_ndx_p = -1;
+ *flist_p = NULL;
+ return node->data;
+ }
#endif
do {
pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
#endif
do {
pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
}
if (maybe_hard_link(file, ndx, fname, statret, sxp, prev_name, &prev_st,
}
if (maybe_hard_link(file, ndx, fname, statret, sxp, prev_name, &prev_st,
file = flist->files[ndx - flist->ndx_start];
file->flags = (file->flags & ~FLAG_HLINK_FIRST) | FLAG_HLINK_DONE;
prev_ndx = F_HL_PREV(file);
F_HL_PREV(file) = fin_ndx;
file = flist->files[ndx - flist->ndx_start];
file->flags = (file->flags & ~FLAG_HLINK_FIRST) | FLAG_HLINK_DONE;
prev_ndx = F_HL_PREV(file);
F_HL_PREV(file) = fin_ndx;
- prev_name = f_name(file, NULL);
- prev_statret = link_stat(prev_name, &prev_sx.st, 0);
+ prev_statret = link_stat(f_name(file, prev_name), &prev_sx.st, 0);
val = maybe_hard_link(file, ndx, prev_name, prev_statret, &prev_sx,
our_name, stp, fname, itemizing, code);
flist->in_progress--;
#ifdef SUPPORT_ACLS
if (preserve_acls)
free_acl(&prev_sx);
val = maybe_hard_link(file, ndx, prev_name, prev_statret, &prev_sx,
our_name, stp, fname, itemizing, code);
flist->in_progress--;
#ifdef SUPPORT_ACLS
if (preserve_acls)
free_acl(&prev_sx);