builtin/pack-objects.c: use die_errno() and warning_errno()

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Nguyễn Thái Ngọc Duy 2016-05-08 16:47:30 +07:00 committed by Junio C Hamano
parent 62f94d54a9
commit 54d47394b4
1 changed files with 2 additions and 4 deletions

View File

@ -828,8 +828,7 @@ static void write_pack_file(void)
* to preserve this property.
*/
if (stat(pack_tmp_name, &st) < 0) {
warning("failed to stat %s: %s",
pack_tmp_name, strerror(errno));
warning_errno("failed to stat %s", pack_tmp_name);
} else if (!last_mtime) {
last_mtime = st.st_mtime;
} else {
@ -837,8 +836,7 @@ static void write_pack_file(void)
utb.actime = st.st_atime;
utb.modtime = --last_mtime;
if (utime(pack_tmp_name, &utb) < 0)
warning("failed utime() on %s: %s",
pack_tmp_name, strerror(errno));
warning_errno("failed utime() on %s", pack_tmp_name);
}

strbuf_addf(&tmpname, "%s-", base_name);