aboutsummaryrefslogtreecommitdiff
path: root/src/rc-misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc-misc.h')
-rw-r--r--src/rc-misc.h15
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