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 /builtin-pack-objects.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 'builtin-pack-objects.c')
| -rw-r--r-- | builtin-pack-objects.c | 14 | 
1 files changed, 5 insertions, 9 deletions
| diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index 941cc2d73c..a27c2f6277 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -536,11 +536,9 @@ static void write_pack_file(void)  				 base_name, sha1_to_hex(sha1));  			free_pack_by_name(tmpname);  			if (adjust_perm(pack_tmp_name, mode)) -				die("unable to make temporary pack file readable: %s", -				    strerror(errno)); +				die_errno("unable to make temporary pack file readable");  			if (rename(pack_tmp_name, tmpname)) -				die("unable to rename temporary pack file: %s", -				    strerror(errno)); +				die_errno("unable to rename temporary pack file");  			/*  			 * Packs are runtime accessed in their mtime @@ -566,11 +564,9 @@ static void write_pack_file(void)  			snprintf(tmpname, sizeof(tmpname), "%s-%s.idx",  				 base_name, sha1_to_hex(sha1));  			if (adjust_perm(idx_tmp_name, mode)) -				die("unable to make temporary index file readable: %s", -				    strerror(errno)); +				die_errno("unable to make temporary index file readable");  			if (rename(idx_tmp_name, tmpname)) -				die("unable to rename temporary index file: %s", -				    strerror(errno)); +				die_errno("unable to rename temporary index file");  			free(idx_tmp_name);  			free(pack_tmp_name); @@ -1879,7 +1875,7 @@ static void read_object_list_from_stdin(void)  			if (!ferror(stdin))  				die("fgets returned NULL, not EOF, not error!");  			if (errno != EINTR) -				die("fgets: %s", strerror(errno)); +				die_errno("fgets");  			clearerr(stdin);  			continue;  		} | 
