diff options
author | William Hubbs <williamh@gentoo.org> | 2012-02-25 15:00:03 -0600 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2012-02-25 15:00:03 -0600 |
commit | 582c8e986840158db3162a89cf85c29ec4bf7107 (patch) | |
tree | c9391af3b17eea6e5adb179bd24b5f7a9da5fd9b /src/librc/librc-misc.c | |
parent | de6323ba51fb8525fb1e48b0331c15daf86d5916 (diff) | |
download | openrc-582c8e986840158db3162a89cf85c29ec4bf7107.tar.gz openrc-582c8e986840158db3162a89cf85c29ec4bf7107.tar.bz2 openrc-582c8e986840158db3162a89cf85c29ec4bf7107.tar.xz |
librc: make rc_proc_getent available for all operating systems
This looks up an option on the kernel command line. For now, itworks on
linux and returns NULL on the bsds, but we are definitely open to
patches for that side.
Diffstat (limited to 'src/librc/librc-misc.c')
-rw-r--r-- | src/librc/librc-misc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librc/librc-misc.c b/src/librc/librc-misc.c index 6e9fce6..06f97e7 100644 --- a/src/librc/librc-misc.c +++ b/src/librc/librc-misc.c @@ -128,10 +128,10 @@ rc_getline(char **line, size_t *len, FILE *fp) } librc_hidden_def(rc_getline) -#ifdef __linux__ char * rc_proc_getent(const char *ent) { +#ifdef __linux__ FILE *fp; char *proc, *p, *value = NULL; size_t i, len; @@ -171,9 +171,11 @@ rc_proc_getent(const char *ent) free(proc); return value; +#else + return NULL; +#endif } librc_hidden_def(rc_proc_getent) -#endif RC_STRINGLIST * rc_config_list(const char *file) |