Without this change, each diagnostic could use an errno value
clobbered by the close or unlink in rollback_lock_file.
Signed-off-by: Jim Meyering <meyering@redhat.com>
---
fast-import.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 5e89eef..45b4edf 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1541,9 +1541,10 @@ static void dump_marks(void)
f = fdopen(mark_fd, "w");
if (!f) {
+ int saved_errno = errno;
rollback_lock_file(&mark_lock);
failure |= error("Unable to write marks file %s: %s",
- mark_file, strerror(errno));
+ mark_file, strerror(saved_errno));
return;
}
@@ -1556,16 +1557,18 @@ static void dump_marks(void)
dump_marks_helper(f, 0, marks);
if (ferror(f) || fclose(f)) {
+ int saved_errno = errno;
rollback_lock_file(&mark_lock);
failure |= error("Unable to write marks file %s: %s",
- mark_file, strerror(errno));
+ mark_file, strerror(saved_errno));
return;
}
if (commit_lock_file(&mark_lock)) {
+ int saved_errno = errno;
rollback_lock_file(&mark_lock);
failure |= error("Unable to commit marks file %s: %s",
- mark_file, strerror(errno));
+ mark_file, strerror(saved_errno));
return;
}
}
--
1.5.4.rc3.31.g669237
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html| Hiten Pandya | Re: up? (emacs docbook xml ide) |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
| James Bottomley | Re: [Ksummit-2008-discuss] Fixing the Kernel Janitors project |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
