aboutsummaryrefslogtreecommitdiff
path: root/src/librc/librc.c
diff options
context:
space:
mode:
authorDoug Freed <dwfreed@mtu.edu>2016-01-17 22:05:22 -0800
committerWilliam Hubbs <w.d.hubbs@gmail.com>2016-01-19 00:09:20 -0600
commit36dde4e7f21afba36a96837aa86f2b5d2dae3807 (patch)
tree27befb1c7b35cfe1266d1db4fb9e843e668a0a1f /src/librc/librc.c
parent649f63d882d53533ae8b1c3b28967e772e738c45 (diff)
librc: fix handling the nothing special case for rc_sys
Diffstat (limited to 'src/librc/librc.c')
-rw-r--r--src/librc/librc.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/librc/librc.c b/src/librc/librc.c
index 5cf4898f..8b4e8d4e 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)