Print the real filename that we failed to open.
When we fail to open a temporary file to be renamed to something else, we reported the final filename, not the temporary file we failed to open. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
André Goddard Rosa committed
Nov 21, 2007 at 18:59 UTC
84ef033832af9e0be886214c70b2006b08630072
3 files changed
+5
-5
http-push.c
+2
-2
@@ -433,7 +433,7 @@ static void start_fetch_packed(struct transfer_request *request)
433
packfile = fopen(request->tmpfile, "a");
434
if (!packfile) {
435
fprintf(stderr, "Unable to open local file %s for pack",
436
- filename);
436
+ request->tmpfile);
437
remote->can_update_info_refs = 0;
438
free(url);
439
return;
@@ -941,7 +941,7 @@ static int fetch_index(unsigned char *sha1)
941
indexfile = fopen(tmpfile, "a");
942
if (!indexfile)
943
return error("Unable to open local file %s for pack index",
944
- filename);
944
+ tmpfile);
945
946
slot = get_active_slot();
947
slot->results = &results;
http-walker.c
+2
-2
@@ -405,7 +405,7 @@ static int fetch_index(struct walker *walker, struct alt_base *repo, unsigned ch
405
indexfile = fopen(tmpfile, "a");
406
if (!indexfile)
407
return error("Unable to open local file %s for pack index",
408
- filename);
408
+ tmpfile);
409
410
slot = get_active_slot();
411
slot->results = &results;
@@ -770,7 +770,7 @@ static int fetch_pack(struct walker *walker, struct alt_base *repo, unsigned cha
770
packfile = fopen(tmpfile, "a");
771
if (!packfile)
772
return error("Unable to open local file %s for pack",
773
- filename);
773
+ tmpfile);
774
775
slot = get_active_slot();
776
slot->results = &results;
server-info.c
+1
-1
@@ -35,7 +35,7 @@ static int update_info_refs(int force)
35
safe_create_leading_directories(path0);
36
info_ref_fp = fopen(path1, "w");
37
if (!info_ref_fp)
38
- return error("unable to update %s", path0);
38
+ return error("unable to update %s", path1);
39
for_each_ref(add_info_ref, NULL);
40
fclose(info_ref_fp);
41
adjust_shared_perm(path1);