diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-06-22 22:13:52 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-06-22 22:13:52 +0200 |
commit | 72036eff02d70100dd5a1caeae6887a4e253348f (patch) | |
tree | da0989dbc1cf57d86b492f3735ccae570131714d | |
parent | b69bbf2b95cf086e1a2be541561b374796d28d44 (diff) |
Print result of strerror()
-rw-r--r-- | src/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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] = |