aboutsummaryrefslogtreecommitdiff
path: root/src/rc-status
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
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')
-rw-r--r--src/rc-status/meson.build2
-rw-r--r--src/rc-status/rc-status.c13
2 files changed, 14 insertions, 1 deletions
diff --git a/src/rc-status/meson.build b/src/rc-status/meson.build
index 7377d837..ee3f3782 100644
--- a/src/rc-status/meson.build
+++ b/src/rc-status/meson.build
@@ -1,6 +1,6 @@
executable('rc-status',
['rc-status.c', misc_c, usage_c, version_h],
- c_args : cc_branding_flags,
+ c_args : [cc_branding_flags, cc_user_services_flags],
link_with: [libeinfo, librc],
dependencies: [util_dep],
include_directories: [incdir, einfo_incdir, rc_incdir],
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
}