aboutsummaryrefslogtreecommitdiff
path: root/init/halt.c
diff options
context:
space:
mode:
Diffstat (limited to 'init/halt.c')
-rw-r--r--init/halt.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/init/halt.c b/init/halt.c
index c14f0f221..4fac3a86b 100644
--- a/init/halt.c
+++ b/init/halt.c
@@ -37,7 +37,6 @@ RB_AUTOBOOT
int which, flags, rc = 1;
#if ENABLE_FEATURE_WTMP
struct utmp utmp;
- struct timeval tv;
struct utsname uts;
#endif
@@ -56,9 +55,7 @@ RB_AUTOBOOT
close(creat(bb_path_wtmp_file, 0664));
}
memset(&utmp, 0, sizeof(utmp));
- gettimeofday(&tv, NULL);
- utmp.ut_tv.tv_sec = tv.tv_sec;
- utmp.ut_tv.tv_usec = tv.tv_usec;
+ utmp.ut_tv.tv_sec = time(NULL);
safe_strncpy(utmp.ut_user, "shutdown", UT_NAMESIZE);
utmp.ut_type = RUN_LVL;
safe_strncpy(utmp.ut_id, "~~", sizeof(utmp.ut_id));