diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2015-12-23 14:06:31 -0600 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2016-01-12 10:42:14 -0600 |
commit | bf2f40828ee26d3ba9185f29db596ee5d7b9cf61 (patch) | |
tree | de1ccdb2fd86e476323908c37ae6588a9ac9ae97 /src/includes | |
parent | fe485f44339963fdbee143687dcbef2069924bc6 (diff) |
Remove multicall binary structure from OpenRC
This eliminates the need for the selinux-specific wrapper scrript we
were installing in /lib*/rc/{bin,sbin}.
Diffstat (limited to 'src/includes')
-rw-r--r-- | src/includes/helpers.h | 17 | ||||
-rw-r--r-- | src/includes/rc-misc.h | 24 |
2 files changed, 27 insertions, 14 deletions
diff --git a/src/includes/helpers.h b/src/includes/helpers.h index c541f99a..1a00d3d0 100644 --- a/src/includes/helpers.h +++ b/src/includes/helpers.h @@ -53,6 +53,9 @@ } while (/* CONSTCOND */ 0) #endif +#include <stdbool.h> +#include <sys/stat.h> + _unused static void *xmalloc (size_t size) { void *value = malloc(size); @@ -104,4 +107,18 @@ _unused static const char *basename_c(const char *path) return (path); } +_unused static bool exists(const char *pathname) +{ + struct stat buf; + + return (stat(pathname, &buf) == 0); +} + +_unused static bool existss(const char *pathname) +{ + struct stat buf; + + return (stat(pathname, &buf) == 0 && buf.st_size != 0); +} + #endif diff --git a/src/includes/rc-misc.h b/src/includes/rc-misc.h index 89d6336b..96166341 100644 --- a/src/includes/rc-misc.h +++ b/src/includes/rc-misc.h @@ -26,6 +26,7 @@ #include <unistd.h> #include "helpers.h" +#include "rc.h" #define RC_LEVEL_BOOT "boot" #define RC_LEVEL_DEFAULT "default" @@ -41,20 +42,6 @@ #define RC_SVCDIR_STARTED RC_SVCDIR "/started" #define RC_SVCDIR_COLDPLUGGED RC_SVCDIR "/coldplugged" -_unused static bool exists(const char *pathname) -{ - struct stat buf; - - return (stat(pathname, &buf) == 0); -} - -_unused static bool existss(const char *pathname) -{ - struct stat buf; - - return (stat(pathname, &buf) == 0 && buf.st_size != 0); -} - char *rc_conf_value(const char *var); bool rc_conf_yesno(const char *var); void env_filter(void); @@ -78,4 +65,13 @@ const char *detect_prefix(void); const char *get_systype(void); const char *detect_container(void); const char *detect_vm(void); + +/* Handy function so we can wrap einfo around our deptree */ +RC_DEPTREE *_rc_deptree_load (int, int *); + +/* Test to see if we can see pid 1 or not */ +bool _rc_can_find_pids(void); + +RC_SERVICE lookup_service_state(const char *service); + #endif |