* [gentoo-commits] proj/openrc:0.20.x commit in: src/librc/
@ 2016-01-19 19:41 William Hubbs
0 siblings, 0 replies; 2+ messages in thread
From: William Hubbs @ 2016-01-19 19:41 UTC (permalink / raw
To: gentoo-commits
commit: 290a91e8e9242582ee13c7343b630b097e2eeaf2
Author: Doug Freed <dwfreed <AT> mtu <DOT> edu>
AuthorDate: Mon Jan 18 06:05:22 2016 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Jan 19 16:54:52 2016 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=290a91e8
librc: fix handling the nothing special case for rc_sys
src/librc/librc.c | 15 +++++++++++++--
src/librc/rc.h.in | 1 +
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/librc/librc.c b/src/librc/librc.c
index 5cf4898..8b4e8d4 100644
--- a/src/librc/librc.c
+++ b/src/librc/librc.c
@@ -228,8 +228,13 @@ static const char *
detect_container(const char *systype)
{
#ifdef __FreeBSD__
- if (systype && strcmp(systype, RC_SYS_JAIL) == 0)
- return RC_SYS_JAIL;
+ if (systype) {
+ if (strcmp(systype, RC_SYS_NONE) == 0)
+ return NULL;
+ if (strcmp(systype, RC_SYS_JAIL) == 0)
+ return RC_SYS_JAIL;
+ }
+
int jailed = 0;
size_t len = sizeof(jailed);
@@ -240,6 +245,8 @@ detect_container(const char *systype)
#ifdef __linux__
if (systype) {
+ if (strcmp(systype, RC_SYS_NONE) == 0)
+ return NULL;
if (strcmp(systype, RC_SYS_UML) == 0)
return RC_SYS_UML;
if (strcmp(systype, RC_SYS_VSERVER) == 0)
@@ -283,6 +290,8 @@ detect_vm(const char *systype)
{
#ifdef __NetBSD__
if (systype) {
+ if (strcmp(systype, RC_SYS_NONE) == 0)
+ return NULL;
if (strcmp(systype, RC_SYS_XEN0) == 0)
return RC_SYS_XEN0;
if (strcmp(systype, RC_SYS_XENU) == 0)
@@ -296,6 +305,8 @@ detect_vm(const char *systype)
#ifdef __linux__
if (systype) {
+ if (strcmp(systype, RC_SYS_NONE) == 0)
+ return NULL;
if (strcmp(systype, RC_SYS_XEN0) == 0)
return RC_SYS_XEN0;
if (strcmp(systype, RC_SYS_XENU) == 0)
diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in
index 55fbc44..92ecbb4 100644
--- a/src/librc/rc.h.in
+++ b/src/librc/rc.h.in
@@ -318,6 +318,7 @@ bool rc_service_daemons_crashed(const char *);
* Some services cannot work in these systems, or we do something else. */
#define RC_SYS_DOCKER "DOCKER"
#define RC_SYS_JAIL "JAIL"
+#define RC_SYS_NONE ""
#define RC_SYS_OPENVZ "OPENVZ"
#define RC_SYS_LXC "LXC"
#define RC_SYS_PREFIX "PREFIX"
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/openrc:0.20.x commit in: src/librc/
@ 2016-01-19 19:41 William Hubbs
0 siblings, 0 replies; 2+ messages in thread
From: William Hubbs @ 2016-01-19 19:41 UTC (permalink / raw
To: gentoo-commits
commit: 3a307109168ac82f37a9a85a81b7b527a57665e5
Author: Doug Freed <dwfreed <AT> mtu <DOT> edu>
AuthorDate: Mon Jan 18 06:39:11 2016 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Jan 19 16:54:52 2016 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=3a307109
librc: handle rc_sys="prefix" even if we weren't built with a prefix
This probably isn't needed, but it mimics old behavior.
src/librc/librc.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/librc/librc.c b/src/librc/librc.c
index 8b4e8d4..3e1f0d8 100644
--- a/src/librc/librc.c
+++ b/src/librc/librc.c
@@ -220,6 +220,13 @@ detect_prefix(const char *systype)
#ifdef PREFIX
return RC_SYS_PREFIX;
#else
+ if (systype) {
+ if (strcmp(systype, RC_SYS_NONE) == 0)
+ return NULL;
+ if (strcmp(systype, RC_SYS_PREFIX) == 0)
+ return RC_SYS_PREFIX;
+ }
+
return NULL;
#endif
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-19 19:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-19 19:41 [gentoo-commits] proj/openrc:0.20.x commit in: src/librc/ William Hubbs
-- strict thread matches above, loose matches on Subject: below --
2016-01-19 19:41 William Hubbs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox