From d3e9d64b17517dcbe0af8b055c1d282e63ba6534 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 8 Jan 2007 03:25:47 -0500 Subject: Add xaccess() --- lib/functions.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/functions.c') diff --git a/lib/functions.c b/lib/functions.c index e37887ed..e476557c 100644 --- a/lib/functions.c +++ b/lib/functions.c @@ -140,6 +140,11 @@ void xexec(char **argv) error_exit("No %s", argv[0]); } +void xaccess(char *path, int flags) +{ + if (access(path, flags)) error_exit("Can't access '%s'\n", path); +} + // Die unless we can open/create a file, returning file descriptor. int xcreate(char *path, int flags, int mode) { -- cgit v1.2.3