Displaying 3 results from an estimated 3 matches for "hlink_compare".
2002 Jan 13
1
rsynd-2.5.1 / hlink.c patches
Platform: Compaq OpenVMS Alpha 7.3
Compiler: Compaq C T6.5
The following patch resolves compile problems with the HLINK.C module.
The cast on function argument for the qsort() routine was wrong, and not
allowing the compile to complete.
When the function definiton of the hlink_compare() is corrected to have
the const qualifiers, the cast inside the qsort() function call is no
longer needed.
-John
wb8tyw@qsl.network
Personal Opinion Only
EAGLE> gdiff -u ref_src:hlink.c lcl_src:hlink.c_unix
--- ref_src:hlink.c Sat Jan 5 13:27:03 2002
+++ lcl_src:hlink.c_unix S...
2003 Dec 30
3
The dangers of static buffers in rsync code
...cycles through them. That's both funny and sad...
One obvious problem path is starting from generator.c:generate_files()
function. In there we call in a while loop:
recv_generator(local_name?local_name:f_name(file),flist,i,f), which calls
hlink.c:check_hard_link(), which calls
hlink.c:hlink_compare(), which calls
flist.c:file_compare(), which calls
flist.c:f_name().
Interested parties might want to follow the code, it is easier and more
obvious...
Anyway, the end result is that in recv_generator() the first argument
(fname) is now clobbered by our search through the hlink_lis...
2004 Jan 25
2
scan for first existing hard-link file
...amp;& !(file->flags & FLAG_HLINK_LAST)) {
+ hlink_list[file->F_INDEX] = file->F_NEXT;
+ return;
+ }
write_int(f_out,i);
write_sum_head(f_out, NULL);
return;
--- hlink.c 22 Jan 2004 04:38:18 -0000 1.30
+++ hlink.c 25 Jan 2004 09:22:23 -0000
@@ -38,8 +38,8 @@ static int hlink_compare(struct file_str
return file_compare(file1, file2);
}
-static struct file_struct **hlink_list;
-static int hlink_count;
+struct file_struct **hlink_list;
+int hlink_count;
#define LINKED(p1,p2) ((p1)->F_DEV == (p2)->F_DEV \
&& (p1)->F_INODE == (p2)->F_INODE)
@@ -56...