diff options
author | Roy Marples <roy@marples.name> | 2007-10-04 17:00:56 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-10-04 17:00:56 +0000 |
commit | 15fde9a796a45999b2fdebebbe8862f33cf4965b (patch) | |
tree | c5ecbd4750bf65a6c309ab64bc4561b2c86aadfb /src/rc-misc.h | |
parent | 87ea3e9e3bfa8e96b31d682f29fc7959bdd1b39e (diff) |
Punt rc_exists from public interface, move to private static inline
Diffstat (limited to 'src/rc-misc.h')
-rw-r--r-- | src/rc-misc.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rc-misc.h b/src/rc-misc.h index bfe54d15..40228b70 100644 --- a/src/rc-misc.h +++ b/src/rc-misc.h @@ -7,6 +7,9 @@ #ifndef __RC_MISC_H__ #define __RC_MISC_H__ +#include <sys/stat.h> +#include <errno.h> + #ifndef LIB # define LIB "lib" #endif @@ -38,4 +41,16 @@ /* Good defaults just incase user has none set */ #define RC_NET_FS_LIST_DEFAULT "afs cifs coda davfs fuse gfs ncpfs nfs nfs4 ocfs2 shfs smbfs" +static inline bool rc_exists (const char *pathname) +{ + struct stat buf; + int serrno = errno; + + if (stat (pathname, &buf) == 0) + return (true); + + errno = serrno; + return (false); +} + #endif |