aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-06-22 22:13:52 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-06-22 22:13:52 +0200
commit72036eff02d70100dd5a1caeae6887a4e253348f (patch)
treeda0989dbc1cf57d86b492f3735ccae570131714d
parentb69bbf2b95cf086e1a2be541561b374796d28d44 (diff)
Print result of strerror()
-rw-r--r--src/main.c6
1 files 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] =