From 72036eff02d70100dd5a1caeae6887a4e253348f Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 22 Jun 2024 22:13:52 +0200 Subject: Print result of strerror() --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 2786475..2451d1a 100644 --- a/src/main.c +++ b/src/main.c @@ -65,11 +65,11 @@ readfile(const char *filename, size_t *n) { int fd = open(filename, O_RDONLY); if (fd == -1) - err("open: %s", filename); + err("open: %s:", filename); struct stat sb; if (fstat(fd, &sb) == -1) - err("fstat: %s", filename); + err("fstat: %s:", filename); char *p = bufalloc(NULL, sb.st_size + 4, 1); @@ -77,7 +77,7 @@ readfile(const char *filename, size_t *n) for (size_t off = 0; (nr = read(fd, p + off, sb.st_blksize)) > 0; off += nr) ; if (nr == -1) - err("read: %s", filename); + err("read: %s:", filename); p[sb.st_size + 0] = p[sb.st_size + 1] = -- cgit v1.2.3