Style fixes
This commit is contained in:
20
src/rc.c
20
src/rc.c
@@ -335,7 +335,7 @@ static char read_key (bool block)
|
|||||||
{
|
{
|
||||||
struct termios termios;
|
struct termios termios;
|
||||||
char c = 0;
|
char c = 0;
|
||||||
|
|
||||||
if (! isatty (STDIN_FILENO))
|
if (! isatty (STDIN_FILENO))
|
||||||
return (false);
|
return (false);
|
||||||
|
|
||||||
@@ -398,7 +398,7 @@ static void sulogin (bool cont)
|
|||||||
newenv = rc_filter_env ();
|
newenv = rc_filter_env ();
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
execle ("/sbin/sulogin", "/sbin/sulogin",
|
execle ("/sbin/sulogin", "/sbin/sulogin",
|
||||||
getenv ("CONSOLE"), (char *) NULL, newenv);
|
getenv ("CONSOLE"), (char *) NULL, newenv);
|
||||||
eerror ("%s: unable to exec `/sbin/sulogin': %s", applet,
|
eerror ("%s: unable to exec `/sbin/sulogin': %s", applet,
|
||||||
strerror (errno));
|
strerror (errno));
|
||||||
#else
|
#else
|
||||||
@@ -413,7 +413,7 @@ static void sulogin (bool cont)
|
|||||||
#ifdef __linux
|
#ifdef __linux
|
||||||
newenv = rc_filter_env ();
|
newenv = rc_filter_env ();
|
||||||
execle ("/sbin/sulogin", "/sbin/sulogin",
|
execle ("/sbin/sulogin", "/sbin/sulogin",
|
||||||
getenv ("CONSOLE"), (char *) NULL, newenv);
|
getenv ("CONSOLE"), (char *) NULL, newenv);
|
||||||
eerrorx ("%s: unable to exec `/sbin/sulogin': %s", applet, strerror (errno));
|
eerrorx ("%s: unable to exec `/sbin/sulogin': %s", applet, strerror (errno));
|
||||||
#else
|
#else
|
||||||
exit (EXIT_SUCCESS);
|
exit (EXIT_SUCCESS);
|
||||||
@@ -528,7 +528,7 @@ static void handle_signal (int sig)
|
|||||||
if (pid > 0)
|
if (pid > 0)
|
||||||
remove_pid (pid);
|
remove_pid (pid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIGINT:
|
case SIGINT:
|
||||||
if (! signame[0])
|
if (! signame[0])
|
||||||
snprintf (signame, sizeof (signame), "SIGINT");
|
snprintf (signame, sizeof (signame), "SIGINT");
|
||||||
@@ -542,21 +542,21 @@ static void handle_signal (int sig)
|
|||||||
case SIGUSR1:
|
case SIGUSR1:
|
||||||
eerror ("rc: Aborting!");
|
eerror ("rc: Aborting!");
|
||||||
/* Kill any running services we have started */
|
/* Kill any running services we have started */
|
||||||
|
|
||||||
signal (SIGCHLD, SIG_IGN);
|
signal (SIGCHLD, SIG_IGN);
|
||||||
for (pl = service_pids; pl; pl = pl->next)
|
for (pl = service_pids; pl; pl = pl->next)
|
||||||
kill (pl->pid, SIGTERM);
|
kill (pl->pid, SIGTERM);
|
||||||
|
|
||||||
/* Notify plugins we are aborting */
|
/* Notify plugins we are aborting */
|
||||||
rc_plugin_run (rc_hook_abort, "rc");
|
rc_plugin_run (rc_hook_abort, "rc");
|
||||||
|
|
||||||
/* Only drop into single user mode if we're booting */
|
/* Only drop into single user mode if we're booting */
|
||||||
run = getenv ("RUNLEVEL");
|
run = getenv ("RUNLEVEL");
|
||||||
prev = getenv ("PREVLEVEL");
|
prev = getenv ("PREVLEVEL");
|
||||||
if ((prev && strcmp (prev, "S") == 0) ||
|
if ((prev && strcmp (prev, "S") == 0) ||
|
||||||
(run &&
|
(run &&
|
||||||
(strcmp (run, "S") == 0 ||
|
(strcmp (run, "S") == 0 ||
|
||||||
strcmp (run, "1") == 0)))
|
strcmp (run, "1") == 0)))
|
||||||
single_user ();
|
single_user ();
|
||||||
|
|
||||||
exit (EXIT_FAILURE);
|
exit (EXIT_FAILURE);
|
||||||
|
@@ -280,13 +280,13 @@ static bool svc_exec (const char *service, const char *arg1, const char *arg2)
|
|||||||
execl (RC_SVCDIR "runscript.sh", service, service, arg1, arg2,
|
execl (RC_SVCDIR "runscript.sh", service, service, arg1, arg2,
|
||||||
(char *) NULL);
|
(char *) NULL);
|
||||||
eerror ("%s: exec `" RC_SVCDIR "runscript.sh': %s",
|
eerror ("%s: exec `" RC_SVCDIR "runscript.sh': %s",
|
||||||
service, strerror (errno));
|
service, strerror (errno));
|
||||||
_exit (EXIT_FAILURE);
|
_exit (EXIT_FAILURE);
|
||||||
} else {
|
} else {
|
||||||
execl (RC_LIBDIR "sh/runscript.sh", service, service, arg1, arg2,
|
execl (RC_LIBDIR "sh/runscript.sh", service, service, arg1, arg2,
|
||||||
(char *) NULL);
|
(char *) NULL);
|
||||||
eerror ("%s: exec `" RC_LIBDIR "sh/runscript.sh': %s",
|
eerror ("%s: exec `" RC_LIBDIR "sh/runscript.sh': %s",
|
||||||
service, strerror (errno));
|
service, strerror (errno));
|
||||||
_exit (EXIT_FAILURE);
|
_exit (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user