* syscalls.cc (login): Fix comment.

(logout): Ditto.
This commit is contained in:
Corinna Vinschen 2003-03-29 13:15:55 +00:00
parent 8304de2e34
commit 856a9750ba
2 changed files with 7 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2003-03-29 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (login): Fix comment.
(logout): Ditto.
2003-03-29 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc: Slightly cleanup all utmp functions.

View File

@ -2501,8 +2501,7 @@ login (struct utmp *ut)
pututline (ut);
endutent ();
/* Read/write to utmp must be atomic to prevent overriding data
by concurrent processes. */
/* Writing to wtmp must be atomic to prevent mixed up data. */
HANDLE mutex = CreateMutex (NULL, FALSE, shared_name ("wtmp_mutex", 0));
if (mutex)
while (WaitForSingleObject (mutex, INFINITE) == WAIT_ABANDONED)
@ -2540,8 +2539,7 @@ logout (char *line)
ut_buf.ut_type = DEAD_PROCESS;
memset (ut_buf.ut_user, 0, sizeof ut_buf.ut_user);
time (&ut_buf.ut_time);
/* Read/write to utmp must be atomic to prevent overriding data
by concurrent processes. */
/* Writing to wtmp must be atomic to prevent mixed up data. */
HANDLE mutex = CreateMutex (NULL, FALSE, shared_name ("wtmp_mutex", 0));
if (mutex)
while (WaitForSingleObject (mutex, INFINITE) == WAIT_ABANDONED)