Convert existing die(..., strerror(errno)) to die_errno()
Change calls to die(..., strerror(errno)) to use the new die_errno(). In the process, also make slight style adjustments: at least state _something_ about the function that failed (instead of just printing the pathname), and put paths in single quotes. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
f8b5a8e13c
commit
d824cbba02
@ -438,7 +438,7 @@ static void flush_buffer(int fd, const char *buf, unsigned long size)
|
||||
/* Ignore epipe */
|
||||
if (errno == EPIPE)
|
||||
break;
|
||||
die("merge-recursive: %s", strerror(errno));
|
||||
die_errno("merge-recursive");
|
||||
} else if (!ret) {
|
||||
die("merge-recursive: disk full?");
|
||||
}
|
||||
@ -554,7 +554,7 @@ static void update_file_flags(struct merge_options *o,
|
||||
mode = 0666;
|
||||
fd = open(path, O_WRONLY | O_TRUNC | O_CREAT, mode);
|
||||
if (fd < 0)
|
||||
die("failed to open %s: %s", path, strerror(errno));
|
||||
die_errno("failed to open '%s'", path);
|
||||
flush_buffer(fd, buf, size);
|
||||
close(fd);
|
||||
} else if (S_ISLNK(mode)) {
|
||||
@ -562,7 +562,7 @@ static void update_file_flags(struct merge_options *o,
|
||||
safe_create_leading_directories_const(path);
|
||||
unlink(path);
|
||||
if (symlink(lnk, path))
|
||||
die("failed to symlink %s: %s", path, strerror(errno));
|
||||
die_errno("failed to symlink '%s'", path);
|
||||
free(lnk);
|
||||
} else
|
||||
die("do not know what to do with %06o %s '%s'",
|
||||
|
||||
Reference in New Issue
Block a user