diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-03-23 13:25:30 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-03-23 13:25:30 +0000 |
commit | 31e125226d429c2f6df010a9277bb9ebfdc2cf54 (patch) | |
tree | 6a8a14df7dbb99058b5930d1fd3bdc654fcbcfe6 /hlink.c | |
parent | 3a6a366fc5ac1f418446128de50b4f2a174399fc (diff) | |
download | rsync-31e125226d429c2f6df010a9277bb9ebfdc2cf54.tar.gz rsync-31e125226d429c2f6df010a9277bb9ebfdc2cf54.tar.bz2 rsync-31e125226d429c2f6df010a9277bb9ebfdc2cf54.zip |
added wrappers around all the system calls that can change what is on
disk. The wrappers check for dry_run.
Diffstat (limited to 'hlink.c')
-rw-r--r-- | hlink.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -121,7 +121,7 @@ void do_hard_links(struct file_list *flist) if (link_stat(f_name(&hlink_list[i-1]),&st1) != 0) continue; if (link_stat(f_name(&hlink_list[i]),&st2) != 0) { - if (!dry_run && link(f_name(&hlink_list[i-1]),f_name(&hlink_list[i])) != 0) { + if (do_link(f_name(&hlink_list[i-1]),f_name(&hlink_list[i])) != 0) { if (verbose > 0) fprintf(FINFO,"link %s => %s : %s\n", f_name(&hlink_list[i]), @@ -131,8 +131,8 @@ void do_hard_links(struct file_list *flist) } else { if (st2.st_dev == st1.st_dev && st2.st_ino == st1.st_ino) continue; - if (!dry_run && (unlink(f_name(&hlink_list[i])) != 0 || - link(f_name(&hlink_list[i-1]),f_name(&hlink_list[i])) != 0)) { + if (do_unlink(f_name(&hlink_list[i])) != 0 || + do_link(f_name(&hlink_list[i-1]),f_name(&hlink_list[i])) != 0) { if (verbose > 0) fprintf(FINFO,"link %s => %s : %s\n", f_name(&hlink_list[i]), |