aboutsummaryrefslogtreecommitdiff
path: root/lib/xwrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xwrap.c')
-rw-r--r--lib/xwrap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c
index adf3e752..9f1dc996 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -172,6 +172,15 @@ int xdup(int fd)
return fd;
}
+FILE *xfdopen(int fd, char *mode)
+{
+ FILE *f = fdopen(fd, mode);
+
+ if (!f) perror_exit("xfdopen");
+
+ return f;
+}
+
// Die unless we can open/create a file, returning FILE *.
FILE *xfopen(char *path, char *mode)
{