aboutsummaryrefslogtreecommitdiff
path: root/login/tst-utmp.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-04-04 01:54:59 +0000
committerUlrich Drepper <drepper@redhat.com>2001-04-04 01:54:59 +0000
commit468946739b3f7e6031d4843fc9a9d5a6e8a16114 (patch)
treeed9798b68f273f0c295d89fec150292fd6688fb7 /login/tst-utmp.c
parent194c5f8d0f6da9d84211b479adb58e118f302ae3 (diff)
downloadglibc-468946739b3f7e6031d4843fc9a9d5a6e8a16114.tar
glibc-468946739b3f7e6031d4843fc9a9d5a6e8a16114.tar.gz
glibc-468946739b3f7e6031d4843fc9a9d5a6e8a16114.tar.bz2
glibc-468946739b3f7e6031d4843fc9a9d5a6e8a16114.zip
Update.
2001-03-29 Michael Keezer <mkeezer@redhat.com> * posix/tst-gnuglob.c: Added ifdef _DIRENT_HAVE_D_TYPE. * login/tst-utmp.c: Handle case where ut_tv is not available but ut_time is. * sysdeps/unix/sysv/aix/utmpx.h: New file. * sysdeps/unix/sysv/aix/bits/utmpx.h: Added _HAVE_UT_TYPE/PID/ID/TV/HOST defines. * sysdeps/unix/sysv/aix/libc-start.c: Removed temp code and made stub. * sysdeps/unix/sysv/aix/gettimeofday.c: New file added routines to access RTCU timer reg. * sysdeps/unix/sysv/aix/Makefile: Remove /usr/lib/crt0.o added dl-libc, dl-open,dl-sym, dl-close to misc. * sysdeps/unix/sysv/aix/start.c: New file. Start code. * sysdeps/unix/sysv/aix/dlldr.h: New file. AIX __loadx defines. * sysdeps/unix/sysv/aix/dl-close.c: New file. AIX dl-close. * sysdeps/unix/sysv/aix/dl-open.c: New file. AIX dl-open. * sysdeps/unix/sysv/aix/dl-sym.c: New file. AIX dl-sym. * sysdeps/unix/sysv/aix/dl-libc.c: New file. libc_dl-xxx support. * sysdeps/generic/strtoll.c: Added SHLIB_COMPAT(libc,GLIBC_2_0, GLIBC_2_2). * sysdeps/generic/strtoull.c: Likewise. * sysdeps/powerpc/ppc-mcount.S: Added nop after bl instruction. * sysdeps/unix/sysv/aix/powerpc/memset.c: New file to include sysdeps/generic/memset.c. * sysdeps/unix/sysv/aix/getpeername.c: Define __getpeername.
Diffstat (limited to 'login/tst-utmp.c')
-rw-r--r--login/tst-utmp.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/login/tst-utmp.c b/login/tst-utmp.c
index 9ff8b5ddaa..56823b239e 100644
--- a/login/tst-utmp.c
+++ b/login/tst-utmp.c
@@ -71,20 +71,24 @@ do_prepare (int argc, char *argv[])
error (EXIT_FAILURE, errno, "cannot open test file `%s'", name);
}
-
struct utmp entry[] =
{
- { ut_type: BOOT_TIME, ut_pid: 1, ut_tv: { tv_sec: 1000 } },
- { ut_type: RUN_LVL, ut_pid: 1, ut_tv: { tv_sec: 2000 } },
- { ut_type: INIT_PROCESS, ut_pid: 5, ut_id: "si", ut_tv: { tv_sec: 3000 } },
+#if _HAVE_UT_TV
+#define UT(a) ut_tv:{tv_sec:(a)}
+#else
+#define UT(a) ut_time:(a)
+#endif
+
+ { ut_type: BOOT_TIME, ut_pid: 1, UT(1000) },
+ { ut_type: RUN_LVL, ut_pid: 1, UT(2000) },
+ { ut_type: INIT_PROCESS, ut_pid: 5, ut_id: "si", UT(3000) },
{ ut_type: LOGIN_PROCESS, ut_pid: 23, ut_line: "tty1", ut_id: "1",
- ut_user: "LOGIN", ut_session: 23, ut_tv: { tv_sec: 4000 } },
+ ut_user: "LOGIN", UT(4000) },
{ ut_type: USER_PROCESS, ut_pid: 24, ut_line: "tty2", ut_id: "2",
- ut_user: "albert", ut_session: 24, ut_tv: { tv_sec: 8000 } },
+ ut_user: "albert", UT(8000) },
{ ut_type: USER_PROCESS, ut_pid: 196, ut_line: "ttyp0", ut_id: "p0",
- ut_user: "niels", ut_session: 196, ut_tv: { tv_sec: 10000 } },
- { ut_type: DEAD_PROCESS, ut_line: "ttyp1", ut_id: "p1",
- ut_tv: { tv_sec: 16000 } },
+ ut_user: "niels", UT(10000) },
+ { ut_type: DEAD_PROCESS, ut_line: "ttyp1", ut_id: "p1", UT(16000) },
{ ut_type: EMPTY },
{ ut_type: EMPTY }
};
@@ -161,8 +165,11 @@ simulate_login (const char *line, const char *user)
entry[n].ut_pid = (entry_pid += 27);
entry[n].ut_type = USER_PROCESS;
strcpy (entry[n].ut_user, user);
+#if _HAVE_UT_TV - 0
entry[n].ut_tv.tv_sec = (entry_time += 1000);
-
+#else
+ entry[n].ut_time = (entry_time += 1000);
+#endif
setutent ();
if (pututline (&entry[n]) == NULL)
@@ -192,8 +199,11 @@ simulate_logout (const char *line)
{
entry[n].ut_type = DEAD_PROCESS;
entry[n].ut_user[0] = '\0';
- entry[n].ut_tv.tv_sec = (entry_time += 1000);
-
+#if _HAVE_UT_TV - 0
+ entry[n].ut_tv.tv_sec = (entry_time += 1000);
+#else
+ entry[n].ut_time = (entry_time += 1000);
+#endif
setutent ();
if (pututline (&entry[n]) == NULL)