diff options
author | Roy Marples <roy@marples.name> | 2007-12-19 14:28:38 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-12-19 14:28:38 +0000 |
commit | ed620aec61752b35914aec8841a2576ceb69a277 (patch) | |
tree | 1f41d6f09b76c8cbe17f924d49bd17bc44c3659b /src | |
parent | bc9cc3dfb5c27d30964dc497d7559c134f3893ef (diff) |
get_options -> service_get_value and save_options -> service_set_value
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 2 | ||||
-rw-r--r-- | src/rc.c | 19 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/Makefile b/src/Makefile index a103679b..602e2320 100644 --- a/src/Makefile +++ b/src/Makefile @@ -69,7 +69,7 @@ RC_BINLINKS = einfon einfo ewarnn ewarn eerrorn eerror ebegin eend ewend \ service_inactive service_wasinactive \ service_coldplugged \ checkown fstabinfo mountinfo rc-depend \ - get_options save_options + service_get_value service_set_value get_options save_options RC_SBINLINKS = mark_service_starting mark_service_started \ mark_service_stopping mark_service_stopped \ mark_service_inactive mark_service_wasinactive \ @@ -391,7 +391,7 @@ static int do_mark_service (int argc, char **argv) return (ok ? EXIT_SUCCESS : EXIT_FAILURE); } -static int do_options (int argc, char **argv) +static int do_value (int argc, char **argv) { bool ok = false; char *service = getenv ("SVCNAME"); @@ -402,14 +402,17 @@ static int do_options (int argc, char **argv) if (argc < 1 || ! argv[0] || strlen (argv[0]) == 0) eerrorx ("%s: no option specified", applet); - if (strcmp (applet, "get_options") == 0) { + if (strcmp (applet, "service_get_value") == 0 || + strcmp (applet, "get_options") == 0) + { char *option = rc_service_value_get (service, argv[0]); if (option) { printf ("%s", option); free (option); ok = true; } - } else if (strcmp (applet, "save_options") == 0) + } else if (strcmp (applet, "service_set_value") == 0 || + strcmp (applet, "save_options") == 0) ok = rc_service_value_set (service, argv[0], argv[1]); else eerrorx ("%s: unknown applet", applet); @@ -846,13 +849,15 @@ int main (int argc, char **argv) if (applet[0] == 'e' || (applet[0] == 'v' && applet[1] == 'e')) exit (do_e (argc, argv)); + if (strcmp (applet, "get_value") == 0 || + strcmp (applet, "set_value") == 0 || + strcmp (applet, "get_options") == 0 || + strcmp (applet, "save_options") == 0) + exit (do_value (argc, argv)); + if (strncmp (applet, "service_", strlen ("service_")) == 0) exit (do_service (argc, argv)); - if (strcmp (applet, "get_options") == 0 || - strcmp (applet, "save_options") == 0) - exit (do_options (argc, argv)); - if (strncmp (applet, "mark_service_", strlen ("mark_service_")) == 0) exit (do_mark_service (argc, argv)); |