UTMP: Set LOGIN_PROCESS for built-in getty

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2016-08-22 12:36:03 +02:00
parent c2ec25efd3
commit 574760df13
3 changed files with 15 additions and 3 deletions
+2 -1
View File
@@ -33,6 +33,7 @@
#include "finit.h"
#include "helpers.h"
#include "sig.h"
#include "utmp-api.h"
#ifndef _PATH_LOGIN
#define _PATH_LOGIN "/bin/login"
@@ -305,7 +306,7 @@ int getty(char *tty, char *baud, char *UNUSED(term))
sigaction(SIGQUIT, &sa, NULL);
stty(fd, speed);
// do_utmp();
utmp_set_login(tty, NULL);
do_getty(tty, name, sizeof(name));
return do_login(name);
+12 -2
View File
@@ -77,7 +77,7 @@ int utmp_set_halt(void)
return utmp_set(RUN_LVL, 0, NULL, NULL, "shutdown");
}
int utmp_set_init(char *tty, char *id)
static int set_getty(int type, char *tty, char *id)
{
char *line;
@@ -94,7 +94,17 @@ int utmp_set_init(char *tty, char *id)
id += 4;
}
return utmp_set(INIT_PROCESS, getpid(), line, id, NULL);
return utmp_set(type, getpid(), line, id, NULL);
}
int utmp_set_init(char *tty, char *id)
{
return set_getty(INIT_PROCESS, tty, id);
}
int utmp_set_login(char *tty, char *id)
{
return set_getty(LOGIN_PROCESS, tty, id);
}
int utmp_set_dead(int pid)
+1
View File
@@ -25,6 +25,7 @@ int utmp_set (int type, int pid, char *line, char *id, char *user);
int utmp_set_boot (void);
int utmp_set_halt (void);
int utmp_set_init (char *tty, char *id);
int utmp_set_login (char *tty, char *id);
int utmp_set_dead (int pid);
int utmp_set_runlevel(int pre, int now);
int utmp_show (char *file);