From 15fde9a796a45999b2fdebebbe8862f33cf4965b Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 4 Oct 2007 17:00:56 +0000 Subject: Punt rc_exists from public interface, move to private static inline --- src/librc-misc.c | 15 --------------- src/rc-misc.h | 15 +++++++++++++++ src/rc.h | 5 ----- src/rc.map | 1 - 4 files changed, 15 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/librc-misc.c b/src/librc-misc.c index 4cc69be0..193b77c0 100644 --- a/src/librc-misc.c +++ b/src/librc-misc.c @@ -132,21 +132,6 @@ char *rc_strcatpaths (const char *path1, const char *paths, ...) } librc_hidden_def(rc_strcatpaths) -bool rc_exists (const char *pathname) -{ - struct stat buf; - - if (! pathname) - return (false); - - if (stat (pathname, &buf) == 0) - return (true); - - errno = 0; - return (false); -} -librc_hidden_def(rc_exists) - char **rc_ls_dir (const char *dir, int options) { DIR *dp; 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 +#include + #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 diff --git a/src/rc.h b/src/rc.h index 5d5ded67..7be9849b 100644 --- a/src/rc.h +++ b/src/rc.h @@ -458,11 +458,6 @@ char *rc_strcatpaths (const char *path1, const char *paths, ...) SENTINEL; * @return true if it matches true, yes or 1, false if otherwise. */ bool rc_env_bool (const char *variable); -/*! Check if the file exists or not - * @param pathname to check - * @return true if it exists, otherwise false */ -bool rc_exists (const char *pathname); - /*! @name rc_ls_dir options */ /*! Ensure that an init.d service exists for each file returned */ #define RC_LS_INITD 0x01 diff --git a/src/rc.map b/src/rc.map index b6ef0a54..6fb6220b 100644 --- a/src/rc.map +++ b/src/rc.map @@ -13,7 +13,6 @@ global: rc_env_config; rc_env_filter; rc_environ_fd; - rc_exists; rc_find_pids; rc_ls_dir; rc_rm_dir; -- cgit v1.2.3