X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/937be4c02816d026de3063f32d82fafda1f3c512..e70701e7285cbdb70e17c4e7e19b4c861b84f25b:/lib/syscalls.c diff --git a/lib/syscalls.c b/lib/syscalls.c index f05b644..66c3d47 100644 --- a/lib/syscalls.c +++ b/lib/syscalls.c @@ -47,8 +47,9 @@ pid_t xfork(void) { return pid; } -void xclose(int fd) { - mustnotbeminus1("close", close(fd)); +void xclose_guts(const char *path, int line, int fd) { + if(close(fd) < 0) + fatal(errno, "%s:%d: close %d", path, line, fd); } void xdup2(int fd1, int fd2) {