aboutsummaryrefslogtreecommitdiff
path: root/src/rc-status/rc-status.c
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-03-14 19:03:52 -0300
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-10-19 10:56:54 +0200
commit9efa44579fd1f60a4c9ace264bb0b968ccb0f7ea (patch)
tree71f6d00e0fe41ae3ac338c6dba21c75f7cb74528 /src/rc-status/rc-status.c
parentb80971ce08dd080529efaf694afc67846e0748b8 (diff)
openrc: Add support for user services.
Modifies many functions where filesystem paths were hardcoded. In non-user-services mode, they still are. In user-services mode, they are allocated, since XDG_ dirs are to be set via environment variables. Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'src/rc-status/rc-status.c')
-rw-r--r--src/rc-status/rc-status.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rc-status/rc-status.c b/src/rc-status/rc-status.c
index 78d5a6af..d56fe830 100644
--- a/src/rc-status/rc-status.c
+++ b/src/rc-status/rc-status.c
@@ -39,7 +39,11 @@ enum format_t {
const char *applet = NULL;
const char *extraopts = NULL;
+#ifdef RC_USER_SERVICES
+const char getoptstring[] = "acf:lmrsSu" getoptstring_COMMON getoptstring_USER_SERVICES;
+#else
const char getoptstring[] = "acf:lmrsSu" getoptstring_COMMON;
+#endif
const struct option longopts[] = {
{"all", 0, NULL, 'a'},
{"crashed", 0, NULL, 'c'},
@@ -50,6 +54,9 @@ const struct option longopts[] = {
{"servicelist", 0, NULL, 's'},
{"supervised", 0, NULL, 'S'},
{"unused", 0, NULL, 'u'},
+#ifdef RC_USER_SERVICES
+ longopts_USER_SERVICES
+#endif
longopts_COMMON
};
const char * const longopts_help[] = {
@@ -62,6 +69,9 @@ const char * const longopts_help[] = {
"Show service list",
"show supervised services",
"Show services not assigned to any runlevel",
+#ifdef RC_USER_SERVICES
+ longopts_help_USER_SERVICES
+#endif
longopts_help_COMMON
};
const char *usagestring = "" \
@@ -354,6 +364,9 @@ int main(int argc, char **argv)
goto exit;
/* NOTREACHED */
+#ifdef RC_USER_SERVICES
+ case_RC_USER_SERVICES
+#endif
case_RC_COMMON_GETOPT
}