aboutsummaryrefslogtreecommitdiff
path: root/lib/functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/functions.c')
-rw-r--r--lib/functions.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/functions.c b/lib/functions.c
index b42f62d3..990c34fa 100644
--- a/lib/functions.c
+++ b/lib/functions.c
@@ -141,13 +141,19 @@ void xexec(char **argv)
}
// Die unless we can open/create a file, returning file descriptor.
-int xopen(char *path, int flags, int mode)
+int xcreate(char *path, int flags, int mode)
{
int fd = open(path, flags, mode);
if (fd == -1) error_exit("No file %s\n", path);
return fd;
}
+// Die unless we can open a file, returning file descriptor.
+int xopen(char *path, int flags)
+{
+ return xcreate(path, flags, 0);
+}
+
// Die unless we can open/create a file, returning FILE *.
FILE *xfopen(char *path, char *mode)
{