From 856a9750ba4b13ac4eaed3b22f25a0ddee391953 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 29 Mar 2003 13:15:55 +0000 Subject: [PATCH] * syscalls.cc (login): Fix comment. (logout): Ditto. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/syscalls.cc | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2ee102abf..c2fd0944e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-03-29 Corinna Vinschen + + * syscalls.cc (login): Fix comment. + (logout): Ditto. + 2003-03-29 Corinna Vinschen * syscalls.cc: Slightly cleanup all utmp functions. diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 230028017..9d5c5a832 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -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)