aboutsummaryrefslogtreecommitdiff
path: root/src/rc/rc-status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc/rc-status.c')
-rw-r--r--src/rc/rc-status.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rc/rc-status.c b/src/rc/rc-status.c
index ef58a147..1e0ef38c 100644
--- a/src/rc/rc-status.c
+++ b/src/rc/rc-status.c
@@ -44,13 +44,16 @@ extern const char *applet;
static bool test_crashed = false;
static const char *const types_nua[] = { "ineed", "iuse", "iafter", NULL };
-bool _rc_findpid1(void)
+bool _rc_can_find_pids(void)
{
RC_PIDLIST *pids;
RC_PID *pid;
RC_PID *pid2;
bool retval = false;
+ if (geteuid() == 0)
+ return true;
+
/* If we cannot see process 1, then we don't test to see if
* services crashed or not */
pids = rc_find_pids(NULL, NULL, 0, 1);
@@ -151,7 +154,7 @@ int rc_status(int argc, char **argv)
int opt;
int depopts = RC_DEP_STRICT | RC_DEP_START | RC_DEP_TRACE;
- test_crashed = _rc_findpid1();
+ test_crashed = _rc_can_find_pids();
while ((opt = getopt_long(argc, argv, getoptstring, longopts,
(int *) 0)) != -1)