aboutsummaryrefslogtreecommitdiff
path: root/src/rc-update.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-04-10 11:24:58 +0000
committerRoy Marples <roy@marples.name>2007-04-10 11:24:58 +0000
commitd3db9e9910ef0a472feb27cf4a9ace78e431ddd9 (patch)
tree7e01917c209258b2f459f63ba42558c3beffb2f5 /src/rc-update.c
parent662e308d86d63750fc1d939e68c2b5ee88fea593 (diff)
Fix indentation
Diffstat (limited to 'src/rc-update.c')
-rw-r--r--src/rc-update.c114
1 files changed, 57 insertions, 57 deletions
diff --git a/src/rc-update.c b/src/rc-update.c
index 8d50a4af..78054136 100644
--- a/src/rc-update.c
+++ b/src/rc-update.c
@@ -32,16 +32,16 @@ static bool add (const char *runlevel, const char *service)
if (rc_service_in_runlevel (service, runlevel))
{
ewarn ("%s already installed in runlevel `%s'; skipping",
- service, runlevel);
+ service, runlevel);
return (false);
}
if (rc_service_add (runlevel, service))
einfo ("%s added to runlevel %s", service, runlevel);
else
- {
+ {
eerror ("%s: failed to add service `%s' to runlevel `%s': %s",
- applet, service, runlevel, strerror (errno));
+ applet, service, runlevel, strerror (errno));
retval = false;
}
@@ -65,53 +65,53 @@ int main (int argc, char **argv)
char **services = rc_services_in_runlevel (NULL);
for (i = 2; i < argc; i++)
- {
- if (strcmp (argv[i], "--verbose") == 0 ||
- strcmp (argv[i], "-v") == 0)
- verbose = true;
- else
- runlevels = rc_strlist_add (runlevels, argv[i]);
- }
+ {
+ if (strcmp (argv[i], "--verbose") == 0 ||
+ strcmp (argv[i], "-v") == 0)
+ verbose = true;
+ else
+ runlevels = rc_strlist_add (runlevels, argv[i]);
+ }
if (! runlevels)
- runlevels = rc_get_runlevels ();
+ runlevels = rc_get_runlevels ();
STRLIST_FOREACH (services, service, i)
- {
- char **in = NULL;
- bool inone = false;
-
- STRLIST_FOREACH (runlevels, runlevel, j)
- {
- if (rc_service_in_runlevel (service, runlevel))
- {
- in = rc_strlist_add (in, runlevel);
- inone = true;
- }
- else
- {
- char buffer[PATH_MAX];
- memset (buffer, ' ', strlen (runlevel));
- buffer[strlen (runlevel)] = 0;
- in = rc_strlist_add (in, buffer);
- }
- }
-
- if (! inone && ! verbose)
- continue;
-
- printf (" %20s |", service);
- STRLIST_FOREACH (in, runlevel, j)
- printf (" %s", runlevel);
- printf ("\n");
- }
-
+ {
+ char **in = NULL;
+ bool inone = false;
+
+ STRLIST_FOREACH (runlevels, runlevel, j)
+ {
+ if (rc_service_in_runlevel (service, runlevel))
+ {
+ in = rc_strlist_add (in, runlevel);
+ inone = true;
+ }
+ else
+ {
+ char buffer[PATH_MAX];
+ memset (buffer, ' ', strlen (runlevel));
+ buffer[strlen (runlevel)] = 0;
+ in = rc_strlist_add (in, buffer);
+ }
+ }
+
+ if (! inone && ! verbose)
+ continue;
+
+ printf (" %20s |", service);
+ STRLIST_FOREACH (in, runlevel, j)
+ printf (" %s", runlevel);
+ printf ("\n");
+ }
+
return (EXIT_SUCCESS);
}
if (geteuid () != 0)
eerrorx ("%s: must be root to add or delete services from runlevels",
- applet);
+ applet);
if (! (service = argv[2]))
eerrorx ("%s: no service specified", applet);
@@ -120,15 +120,15 @@ int main (int argc, char **argv)
strcmp (argv[1], "-a") == 0)
{
if (! service)
- eerrorx ("%s: no service specified", applet);
+ eerrorx ("%s: no service specified", applet);
if (! rc_service_exists (service))
- eerrorx ("%s: service `%s' does not exist", applet, service);
+ eerrorx ("%s: service `%s' does not exist", applet, service);
if (argc < 4)
- add (rc_get_runlevel (), service);
+ add (rc_get_runlevel (), service);
for (i = 3; i < argc; i++)
- add (argv[i], service);
+ add (argv[i], service);
return (EXIT_SUCCESS);
}
@@ -138,22 +138,22 @@ int main (int argc, char **argv)
strcmp (argv[1], "-d") == 0)
{
for (i = 3; i < argc; i++)
- runlevels = rc_strlist_add (runlevels, argv[i]);
+ runlevels = rc_strlist_add (runlevels, argv[i]);
if (! runlevels)
- runlevels = rc_strlist_add (runlevels, rc_get_runlevel ());
+ runlevels = rc_strlist_add (runlevels, rc_get_runlevel ());
STRLIST_FOREACH (runlevels, runlevel, i)
- {
- if (rc_service_in_runlevel (service, runlevel))
- {
- if (rc_service_delete (runlevel, service))
- einfo ("%s removed from runlevel %s", service, runlevel);
- else
- eerror ("%s: failed to remove service `%s' from runlevel `%s': %s",
- applet, service, runlevel, strerror (errno));
- }
- }
+ {
+ if (rc_service_in_runlevel (service, runlevel))
+ {
+ if (rc_service_delete (runlevel, service))
+ einfo ("%s removed from runlevel %s", service, runlevel);
+ else
+ eerror ("%s: failed to remove service `%s' from runlevel `%s': %s",
+ applet, service, runlevel, strerror (errno));
+ }
+ }
return (EXIT_SUCCESS);
}