commit ca7e0702fc08e6986ec8a8e5742bd35efee38ef6
parent 0ca17073690e6ad9e5b1069a0e02f66b88d83506
Author: Jake Koroman <jake@jakekoroman.com>
Date: Tue, 28 Oct 2025 13:11:30 -0400
update POSIX calls to log errno on error.
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/jrk.h b/jrk.h
@@ -637,7 +637,7 @@ jrk_sb_fd_read_all(jrk_StringBuilder *sb, i32 fd)
u64 sz = jrk_fd_size(fd);
jrk_da_reserve(sb, sz);
if (read(fd, sb->items, sz) < 0) {
- jrk_errorv("jrk_sb_fd_read_all(%p, %d)", (void *)sb, fd);
+ jrk_eerrorv("jrk_sb_fd_read_all(%p, %d)", (void *)sb, fd);
return false;
}
@@ -651,7 +651,7 @@ jrk_sb_fd_write_all(jrk_StringBuilder *sb, i32 fd)
i64 result;
result = write(fd, (void *) sb->items, sb->count);
if (result < 0) {
- jrk_errorv("jrk_sb_fd_write_all(%p, %d)", (void *)sb, fd);
+ jrk_eerrorv("jrk_sb_fd_write_all(%p, %d)", (void *)sb, fd);
return -1;
}
@@ -691,7 +691,7 @@ jrk_fd_open_read(char *path)
i32 result = open(path, O_RDONLY);
if (result < 0) {
- jrk_errorv("jrk_fd_open_read(%s)", path);
+ jrk_eerrorv("jrk_fd_open_read(%s)", path);
return -1;
}
@@ -706,7 +706,7 @@ jrk_fd_open_write(char *path)
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (result < 0) {
- jrk_errorv("jrk_fd_open_write(%s)", path);
+ jrk_eerrorv("jrk_fd_open_write(%s)", path);
return -1;
}
@@ -721,7 +721,7 @@ jrk_fd_open_write_append(char *path)
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (result < 0) {
- jrk_errorv("jrk_fd_open_write_append(%s)", path);
+ jrk_eerrorv("jrk_fd_open_write_append(%s)", path);
return -1;
}