Add xaccess()
This commit is contained in:
parent
f3e452a35a
commit
d3e9d64b17
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user