Skip to content

Commit

Permalink
fix potential deadlock in create_one_file
Browse files Browse the repository at this point in the history
It can happen if the temporary file already exists (i.e. after a panic
and reboot).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Alex Riesen authored and Junio C Hamano committed Jan 6, 2006
1 parent 781411e commit d9e08be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,8 @@ static void create_one_file(const char *path, unsigned mode, const char *buf, un
}
if (errno != EEXIST)
break;
}
++nr;
}
}
die("unable to write file %s mode %o", path, mode);
}
Expand Down

0 comments on commit d9e08be

Please sign in to comment.