Skip to content

Commit

Permalink
Don't crash if hardlink source is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Dec 14, 2022
1 parent d7dae33 commit 6d5b175
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,11 @@ static void slave(char *slave_path) {
g_autofree char *hardlink = fn_unescape(word[7]);
g_autoptr(FileInfo) fi_src = fileinfo_lstat(hardlink);
if (!fi_src) {
// source removed, i/o error, --reduce or logic error. We could
// request the file here, but the above cases don't seem to
// ustify this.
warn("%s: hardlink source %s: %m\n", filename, hardlink);
}
if (!fi_is || fi_is->dev != fi_src->dev || fi_is->ino != fi_src->ino) {
} else if (!fi_is || fi_is->dev != fi_src->dev || fi_is->ino != fi_src->ino) {
if (fi_is)
out_of_the_way(fi_is);
if (!quiet)
Expand Down

0 comments on commit 6d5b175

Please sign in to comment.