diff options
| author | Junio C Hamano <gitster@pobox.com> | 2009-07-06 09:39:46 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2009-07-06 09:39:46 -0700 |
| commit | dd787c19c4f011cc3adb422ef856f2c58d989640 (patch) | |
| tree | 1b8fdfb2e14cc423a31ab1ce75c6f05226483da6 /fast-import.c | |
| parent | 864cd9491772367b3ce5b0dda98f068e5bd49680 (diff) | |
| parent | 0721c314a5c8fddc877140ab5a333c42c62f780d (diff) | |
| download | git-dd787c19c4f011cc3adb422ef856f2c58d989640.tar.gz | |
Merge branch 'tr/die_errno'
* tr/die_errno:
Use die_errno() instead of die() when checking syscalls
Convert existing die(..., strerror(errno)) to die_errno()
die_errno(): double % in strerror() output just in case
Introduce die_errno() that appends strerror(errno) to die()
Diffstat (limited to 'fast-import.c')
| -rw-r--r-- | fast-import.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fast-import.c b/fast-import.c index a2a24588a9..7ef9865aa6 100644 --- a/fast-import.c +++ b/fast-import.c @@ -905,10 +905,10 @@ static char *keep_pack(char *curr_index_name) keep_fd = odb_pack_keep(name, sizeof(name), pack_data->sha1); if (keep_fd < 0) - die("cannot create keep file"); + die_errno("cannot create keep file"); write_or_die(keep_fd, keep_msg, strlen(keep_msg)); if (close(keep_fd)) - die("failed to write keep file"); + die_errno("failed to write keep file"); snprintf(name, sizeof(name), "%s/pack/pack-%s.pack", get_object_directory(), sha1_to_hex(pack_data->sha1)); @@ -2342,7 +2342,7 @@ static void import_marks(const char *input_file) char line[512]; FILE *f = fopen(input_file, "r"); if (!f) - die("cannot read %s: %s", input_file, strerror(errno)); + die_errno("cannot read '%s'", input_file); while (fgets(line, sizeof(line), f)) { uintmax_t mark; char *end; @@ -2448,7 +2448,7 @@ int main(int argc, const char **argv) fclose(pack_edges); pack_edges = fopen(a + 20, "a"); if (!pack_edges) - die("Cannot open %s: %s", a + 20, strerror(errno)); + die_errno("Cannot open '%s'", a + 20); } else if (!strcmp(a, "--force")) force_update = 1; else if (!strcmp(a, "--quiet")) |
