summaryrefslogtreecommitdiff
path: root/src/shared/virt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/virt.c')
-rw-r--r--src/shared/virt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/virt.c b/src/shared/virt.c
index 6e44794496..fc62c72328 100644
--- a/src/shared/virt.c
+++ b/src/shared/virt.c
@@ -159,10 +159,10 @@ int detect_container(const char **id) {
/* Unfortunately many of these operations require root access
* in one way or another */
- if (geteuid() != 0)
- return -EPERM;
-
- if (running_in_chroot() > 0) {
+ r = running_in_chroot();
+ if (r < 0)
+ return r;
+ if (r > 0) {
if (id)
*id = "chroot";