(start_login): put utmpx code into a new scope to avoid pre c99 problems.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15196 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-05-20 08:35:51 +00:00
parent 9fe35267a4
commit 3fe17e04c4

View File

@@ -1295,28 +1295,30 @@ start_login(const char *host, int autologin, char *name)
#endif
#ifdef HAVE_UTMPX_H
int pid = getpid();
struct utmpx utmpx;
char *clean_tty;
/*
* Create utmp entry for child
*/
clean_tty = clean_ttyname(line);
memset(&utmpx, 0, sizeof(utmpx));
strncpy(utmpx.ut_user, ".telnet", sizeof(utmpx.ut_user));
strncpy(utmpx.ut_line, clean_tty, sizeof(utmpx.ut_line));
#ifdef HAVE_STRUCT_UTMP_UT_ID
strncpy(utmpx.ut_id, make_id(clean_tty), sizeof(utmpx.ut_id));
#endif
utmpx.ut_pid = pid;
{
int pid = getpid();
struct utmpx utmpx;
char *clean_tty;
utmpx.ut_type = LOGIN_PROCESS;
gettimeofday (&utmpx.ut_tv, NULL);
if (pututxline(&utmpx) == NULL)
fatal(net, "pututxline failed");
/*
* Create utmp entry for child
*/
clean_tty = clean_ttyname(line);
memset(&utmpx, 0, sizeof(utmpx));
strncpy(utmpx.ut_user, ".telnet", sizeof(utmpx.ut_user));
strncpy(utmpx.ut_line, clean_tty, sizeof(utmpx.ut_line));
#ifdef HAVE_STRUCT_UTMP_UT_ID
strncpy(utmpx.ut_id, make_id(clean_tty), sizeof(utmpx.ut_id));
#endif
utmpx.ut_pid = pid;
utmpx.ut_type = LOGIN_PROCESS;
gettimeofday (&utmpx.ut_tv, NULL);
if (pututxline(&utmpx) == NULL)
fatal(net, "pututxline failed");
}
#endif
scrub_env();