summaryrefslogtreecommitdiff
path: root/http-push.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-05-25 19:01:50 -0700
committerJunio C Hamano <gitster@pobox.com>2009-05-25 19:01:50 -0700
commit2c5942dbae01e5c23d2b68aced019702eb256ad9 (patch)
tree38b103a22d51dc22835a06d375bab806c513acdb /http-push.c
parent43f8f560c03f6942cad1f12dd8ae5cfa045c8e84 (diff)
parentf6a5f1bb509a3af182fe568135398f1f2be15e5d (diff)
downloadgit-2c5942dbae01e5c23d2b68aced019702eb256ad9.tar.gz
Merge branch 'ar/unlink-err' into maint
* ar/unlink-err: print unlink(2) errno in copy_or_link_directory replace direct calls to unlink(2) with unlink_or_warn Introduce an unlink(2) wrapper which gives warning if unlink failed
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/http-push.c b/http-push.c
index 9da14201b1..e16a0ad3f9 100644
--- a/http-push.c
+++ b/http-push.c
@@ -315,9 +315,9 @@ static void start_fetch_loose(struct transfer_request *request)
"%s.temp", filename);
snprintf(prevfile, sizeof(prevfile), "%s.prev", request->filename);
- unlink(prevfile);
+ unlink_or_warn(prevfile);
rename(request->tmpfile, prevfile);
- unlink(request->tmpfile);
+ unlink_or_warn(request->tmpfile);
if (request->local_fileno != -1)
error("fd leakage in start: %d", request->local_fileno);
@@ -372,7 +372,7 @@ static void start_fetch_loose(struct transfer_request *request)
} while (prev_read > 0);
close(prevlocal);
}
- unlink(prevfile);
+ unlink_or_warn(prevfile);
/* Reset inflate/SHA1 if there was an error reading the previous temp
file; also rewind to the beginning of the local file. */
@@ -784,7 +784,7 @@ static void finish_request(struct transfer_request *request)
request->http_code != 416) {
if (stat(request->tmpfile, &st) == 0) {
if (st.st_size == 0)
- unlink(request->tmpfile);
+ unlink_or_warn(request->tmpfile);
}
} else {
if (request->http_code == 416)
@@ -793,9 +793,9 @@ static void finish_request(struct transfer_request *request)
git_inflate_end(&request->stream);
git_SHA1_Final(request->real_sha1, &request->c);
if (request->zret != Z_STREAM_END) {
- unlink(request->tmpfile);
+ unlink_or_warn(request->tmpfile);
} else if (hashcmp(request->obj->sha1, request->real_sha1)) {
- unlink(request->tmpfile);
+ unlink_or_warn(request->tmpfile);
} else {
request->rename =
move_temp_to_file(