Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rsync: Add patch to exit on hard link failure
Rsync might crash if we continue after a hard link failure. There is no reasonable way anyway, so just abort with recognizable error code. https://github.com/WayneD/rsync/issues/329 --- hlink.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hlink.c b/hlink.c index 66810a3e..23869872 100644 --- a/hlink.c +++ b/hlink.c @@ -464,7 +464,10 @@ int hard_link_one(struct file_struct *file, const char *fname, code = FERROR_XFER; rsyserr(code, errno, "link %s => %s failed", full_fname(fname), oldname); - return 0; + + /* This is broken beyond repair for --link-dest. No good way to continue here. */ + fprintf(stderr, "Aborting due to hard link failure\n"); + _exit(33); } file->flags |= FLAG_HLINK_DONE; -- 2.36.0
- Loading branch information