diff options
author | Rob Landley <rob@landley.net> | 2007-01-08 03:25:47 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2007-01-08 03:25:47 -0500 |
commit | d3e9d64b17517dcbe0af8b055c1d282e63ba6534 (patch) | |
tree | 240d03a866c79876ad2402ac5028774411bfe964 | |
parent | f3e452a35ab5fd1808be7a50652b54dc3222ba6e (diff) | |
download | toybox-d3e9d64b17517dcbe0af8b055c1d282e63ba6534.tar.gz |
Add xaccess()
-rw-r--r-- | lib/functions.c | 5 | ||||
-rw-r--r-- | lib/lib.h | 1 |
2 files changed, 6 insertions, 0 deletions
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) { @@ -38,6 +38,7 @@ void *xstrndup(char *s, size_t n); void *xstrdup(char *s); char *xmsprintf(char *format, ...); void xexec(char **argv); +void xaccess(char *path, int flags); int xcreate(char *path, int flags, int mode); int xopen(char *path, int flags); FILE *xfopen(char *path, char *mode); |