summaryrefslogtreecommitdiff
path: root/src/librc/librc-misc.c
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2012-02-25 15:00:03 -0600
committerWilliam Hubbs <williamh@gentoo.org>2012-02-25 15:41:31 -0600
commit722871c0ae15221ffcb11c761533f628ec081a57 (patch)
treee51ef0150c02bc230f4de6d4034983c7fa30c89f /src/librc/librc-misc.c
parentd670dbddf75bc76e864deb8e74aebdf9b4ed3a78 (diff)
downloadopenrc-722871c0ae15221ffcb11c761533f628ec081a57.tar.gz
openrc-722871c0ae15221ffcb11c761533f628ec081a57.tar.bz2
openrc-722871c0ae15221ffcb11c761533f628ec081a57.tar.xz
librc: make rc_proc_getent available for all operating systems
This looks up an option on the kernel command line. For now, it works 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.c6
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)