mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
set time to entry only when writing the WTMP file
This commit is contained in:
@@ -198,15 +198,15 @@ static void remove_utmp_entry(main_server_st *s, struct proc_st* proc)
|
||||
if (proc->lease && proc->lease->name)
|
||||
snprintf(entry.ut_line, sizeof(entry.ut_line), "%s", proc->lease->name);
|
||||
entry.ut_pid = proc->pid;
|
||||
gettime(&tv);
|
||||
entry.ut_tv.tv_sec = tv.tv_sec;
|
||||
entry.ut_tv.tv_usec = tv.tv_nsec / 1000;
|
||||
|
||||
setutxent();
|
||||
pututxline(&entry);
|
||||
endutxent();
|
||||
|
||||
#if defined(WTMPX_FILE)
|
||||
gettime(&tv);
|
||||
entry.ut_tv.tv_sec = tv.tv_sec;
|
||||
entry.ut_tv.tv_usec = tv.tv_nsec / 1000;
|
||||
updwtmpx(WTMPX_FILE, &entry);
|
||||
#endif
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user