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
37 int which, flags, rc = 1; 37 int which, flags, rc = 1;
38#if ENABLE_FEATURE_WTMP 38#if ENABLE_FEATURE_WTMP
39 struct utmp utmp; 39 struct utmp utmp;
40 struct timeval tv;
41 struct utsname uts; 40 struct utsname uts;
42#endif 41#endif
43 42
@@ -56,9 +55,7 @@ RB_AUTOBOOT
56 close(creat(bb_path_wtmp_file, 0664)); 55 close(creat(bb_path_wtmp_file, 0664));
57 } 56 }
58 memset(&utmp, 0, sizeof(utmp)); 57 memset(&utmp, 0, sizeof(utmp));
59 gettimeofday(&tv, NULL); 58 utmp.ut_tv.tv_sec = time(NULL);
60 utmp.ut_tv.tv_sec = tv.tv_sec;
61 utmp.ut_tv.tv_usec = tv.tv_usec;
62 safe_strncpy(utmp.ut_user, "shutdown", UT_NAMESIZE); 59 safe_strncpy(utmp.ut_user, "shutdown", UT_NAMESIZE);
63 utmp.ut_type = RUN_LVL; 60 utmp.ut_type = RUN_LVL;
64 safe_strncpy(utmp.ut_id, "~~", sizeof(utmp.ut_id)); 61 safe_strncpy(utmp.ut_id, "~~", sizeof(utmp.ut_id));