aboutsummaryrefslogtreecommitdiff
path: root/lib/xwrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xwrap.c')
-rw-r--r--lib/xwrap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c
index 22f00f2b..607f3c61 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -416,7 +416,7 @@ void xpipe(int *pp)
void xclose(int fd)
{
- if (close(fd)) perror_exit("xclose");
+ if (fd != -1 && close(fd)) perror_exit("xclose");
}
int xdup(int fd)