X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/937be4c02816d026de3063f32d82fafda1f3c512..04024c2cafab56ea76a9a2b35097584d6db98c06:/lib/syscalls.c diff --git a/lib/syscalls.c b/lib/syscalls.c index f05b644..c398c93 100644 --- a/lib/syscalls.c +++ b/lib/syscalls.c @@ -1,6 +1,6 @@ /* * This file is part of DisOrder. - * Copyright (C) 2004, 2005 Richard Kettlewell + * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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) {