From d824cbba02a4061400a0e382f9bd241fbbff34f0 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Sat, 27 Jun 2009 17:58:46 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- write_or_die.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'write_or_die.c') diff --git a/write_or_die.c b/write_or_die.c index 4c29255df..d45b53602 100644 --- a/write_or_die.c +++ b/write_or_die.c @@ -41,14 +41,14 @@ void maybe_flush_or_die(FILE *f, const char *desc) */ if (errno == EPIPE || errno == EINVAL) exit(0); - die("write failure on %s: %s", desc, strerror(errno)); + die_errno("write failure on '%s'", desc); } } void fsync_or_die(int fd, const char *msg) { if (fsync(fd) < 0) { - die("%s: fsync error (%s)", msg, strerror(errno)); + die_errno("fsync error on '%s'", msg); } } @@ -57,7 +57,7 @@ void write_or_die(int fd, const void *buf, size_t count) if (write_in_full(fd, buf, count) < 0) { if (errno == EPIPE) exit(0); - die("write error (%s)", strerror(errno)); + die_errno("write error"); } } -- cgit v1.2.1