Skip to content

Commit

Permalink
Print the real filename that we failed to open.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
André Goddard Rosa authored and Junio C Hamano committed Nov 26, 2007
1 parent 757f58e commit 84ef033
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions http-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ static void start_fetch_packed(struct transfer_request *request)
packfile = fopen(request->tmpfile, "a");
if (!packfile) {
fprintf(stderr, "Unable to open local file %s for pack",
filename);
request->tmpfile);
remote->can_update_info_refs = 0;
free(url);
return;
Expand Down Expand Up @@ -941,7 +941,7 @@ static int fetch_index(unsigned char *sha1)
indexfile = fopen(tmpfile, "a");
if (!indexfile)
return error("Unable to open local file %s for pack index",
filename);
tmpfile);

slot = get_active_slot();
slot->results = &results;
Expand Down
4 changes: 2 additions & 2 deletions http-walker.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static int fetch_index(struct walker *walker, struct alt_base *repo, unsigned ch
indexfile = fopen(tmpfile, "a");
if (!indexfile)
return error("Unable to open local file %s for pack index",
filename);
tmpfile);

slot = get_active_slot();
slot->results = &results;
Expand Down Expand Up @@ -770,7 +770,7 @@ static int fetch_pack(struct walker *walker, struct alt_base *repo, unsigned cha
packfile = fopen(tmpfile, "a");
if (!packfile)
return error("Unable to open local file %s for pack",
filename);
tmpfile);

slot = get_active_slot();
slot->results = &results;
Expand Down
2 changes: 1 addition & 1 deletion server-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static int update_info_refs(int force)
safe_create_leading_directories(path0);
info_ref_fp = fopen(path1, "w");
if (!info_ref_fp)
return error("unable to update %s", path0);
return error("unable to update %s", path1);
for_each_ref(add_info_ref, NULL);
fclose(info_ref_fp);
adjust_shared_perm(path1);
Expand Down

0 comments on commit 84ef033

Please sign in to comment.