* [gentoo-commits] proj/openrc:openrc-0.9.9.x commit in: src/librc/
@ 2012-02-25 21:52 William Hubbs
0 siblings, 0 replies; only message in thread
From: William Hubbs @ 2012-02-25 21:52 UTC (permalink / raw
To: gentoo-commits
commit: 722871c0ae15221ffcb11c761533f628ec081a57
Author: William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 25 21:00:03 2012 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Sat Feb 25 21:41:31 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=722871c0
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.
---
src/librc/librc-misc.c | 6 ++++--
src/librc/rc.h.in | 2 --
2 files changed, 4 insertions(+), 4 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)
diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in
index 468990e..eaae25f 100644
--- a/src/librc/rc.h.in
+++ b/src/librc/rc.h.in
@@ -360,12 +360,10 @@ bool rc_newer_than(const char *, const char *, time_t *, char *);
* @return true if source is older than target, otherwise false */
bool rc_older_than(const char *, const char *, time_t *, char *);
-#ifdef __linux__
/*! Read variables/values from /proc/cmdline
* @param value
* @return pointer to the value, otherwise NULL */
char *rc_proc_getent(const char *);
-#endif
/*! Update the cached dependency tree if it's older than any init script,
* its configuration file or an external configuration file the init script
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-02-25 21:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-25 21:52 [gentoo-commits] proj/openrc:openrc-0.9.9.x commit in: src/librc/ William Hubbs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox