* syscalls.cc (login): Fix comment.
(logout): Ditto.
This commit is contained in:
parent
8304de2e34
commit
856a9750ba
@ -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>
|
2003-03-29 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* syscalls.cc: Slightly cleanup all utmp functions.
|
* syscalls.cc: Slightly cleanup all utmp functions.
|
||||||
|
@ -2501,8 +2501,7 @@ login (struct utmp *ut)
|
|||||||
|
|
||||||
pututline (ut);
|
pututline (ut);
|
||||||
endutent ();
|
endutent ();
|
||||||
/* Read/write to utmp must be atomic to prevent overriding data
|
/* Writing to wtmp must be atomic to prevent mixed up data. */
|
||||||
by concurrent processes. */
|
|
||||||
HANDLE mutex = CreateMutex (NULL, FALSE, shared_name ("wtmp_mutex", 0));
|
HANDLE mutex = CreateMutex (NULL, FALSE, shared_name ("wtmp_mutex", 0));
|
||||||
if (mutex)
|
if (mutex)
|
||||||
while (WaitForSingleObject (mutex, INFINITE) == WAIT_ABANDONED)
|
while (WaitForSingleObject (mutex, INFINITE) == WAIT_ABANDONED)
|
||||||
@ -2540,8 +2539,7 @@ logout (char *line)
|
|||||||
ut_buf.ut_type = DEAD_PROCESS;
|
ut_buf.ut_type = DEAD_PROCESS;
|
||||||
memset (ut_buf.ut_user, 0, sizeof ut_buf.ut_user);
|
memset (ut_buf.ut_user, 0, sizeof ut_buf.ut_user);
|
||||||
time (&ut_buf.ut_time);
|
time (&ut_buf.ut_time);
|
||||||
/* Read/write to utmp must be atomic to prevent overriding data
|
/* Writing to wtmp must be atomic to prevent mixed up data. */
|
||||||
by concurrent processes. */
|
|
||||||
HANDLE mutex = CreateMutex (NULL, FALSE, shared_name ("wtmp_mutex", 0));
|
HANDLE mutex = CreateMutex (NULL, FALSE, shared_name ("wtmp_mutex", 0));
|
||||||
if (mutex)
|
if (mutex)
|
||||||
while (WaitForSingleObject (mutex, INFINITE) == WAIT_ABANDONED)
|
while (WaitForSingleObject (mutex, INFINITE) == WAIT_ABANDONED)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user