summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b99b5b4)
raw | patch | inline | side by side (parent: b99b5b4)
author | Thomas Rast <trast@student.ethz.ch> | |
Thu, 18 Sep 2008 22:24:46 +0000 (00:24 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 19 Sep 2008 02:51:13 +0000 (19:51 -0700) |
5723fe7 (Avoid cross-directory renames and linking on object creation,
2008-06-14) changed the call to use link() directly instead of through a
custom wrapper, but forgot that it returns 0 or -1, not 0 or errno.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-14) changed the call to use link() directly instead of through a
custom wrapper, but forgot that it returns 0 or -1, not 0 or errno.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c | patch | blob | history |
diff --git a/sha1_file.c b/sha1_file.c
index 477d3fb4b06bcbcdd3f75a9e48d5945f91e1f3e6..e2cb342a32f31be2b9ffc1867fbfd671fe63cef1 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
*/
int move_temp_to_file(const char *tmpfile, const char *filename)
{
- int ret = link(tmpfile, filename);
+ int ret = 0;
+ if (link(tmpfile, filename))
+ ret = errno;
/*
* Coda hack - coda doesn't like cross-directory links,