mirror of
https://github.com/troglobit/finit.git
synced 2026-11-25 20:28:23 +00:00
Minor cleanup and default signals also for getty
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
46a58f058a
commit
9416e14074
1 file changed
+7
-6
@@ -95,11 +95,7 @@ int run(char *cmd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
args[i] = NULL;
|
args[i] = NULL;
|
||||||
#if 0
|
|
||||||
_e("Splitting: '%s' =>", cmd);
|
|
||||||
for (i = 0; args[i]; i++)
|
|
||||||
_e("\t%s", args[i]);
|
|
||||||
#endif
|
|
||||||
if (i == NUM_ARGS && args[i]) {
|
if (i == NUM_ARGS && args[i]) {
|
||||||
_e("Command too long: %s", cmd);
|
_e("Command too long: %s", cmd);
|
||||||
free(backup);
|
free(backup);
|
||||||
@@ -229,8 +225,13 @@ pid_t run_getty(char *cmd, char *args[], char *tty, int console)
|
|||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
|
|
||||||
if (!pid) {
|
if (!pid) {
|
||||||
int fd;
|
int i, fd;
|
||||||
char c;
|
char c;
|
||||||
|
struct sigaction sa;
|
||||||
|
|
||||||
|
/* Reset signal handlers that were set by the parent process */
|
||||||
|
for (i = 1; i < NSIG; i++)
|
||||||
|
DFLSIG(sa, i, 0);
|
||||||
|
|
||||||
/* Detach from initial controlling TTY */
|
/* Detach from initial controlling TTY */
|
||||||
vhangup();
|
vhangup();
|
||||||
|
|||||||
Reference in new issue
Block a user