summaryrefslogtreecommitdiff
path: root/libutil/logout.c
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2010-04-06 08:58:29 -0700
committerAustin Foxley <austinf@cetoncorp.com>2010-04-06 08:58:33 -0700
commitf10d127d36ada5b202cdea521e61b05522beb192 (patch)
tree44ae75bf0745de49fb46616afd4cf577cf7a258a /libutil/logout.c
parentc3af26045aa44286482fbfe93097f24b48cfb6a3 (diff)
parent384a55ef9f3387ed33eadab3eefe5057b4daeadb (diff)
Merge commit 'origin/master' into nptl
Conflicts: libc/misc/utmp/utent.c libc/sysdeps/linux/i386/bits/syscalls.h Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libutil/logout.c')
-rw-r--r--libutil/logout.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libutil/logout.c b/libutil/logout.c
index e6d9565ab..5f58b8f42 100644
--- a/libutil/logout.c
+++ b/libutil/logout.c
@@ -29,9 +29,9 @@ logout (const char *line)
struct utmp *ut;
int result = 0;
- /* Tell that we want to use the UTMP file. */
- if (utmpname (_PATH_UTMP) == -1)
- return 0;
+ /* if (utmpname (_PATH_UTMP) == -1) return 0; - why?
+ * this makes it impossible for caller to use other file!
+ * Does any standard or historical precedent says this must be done? */
/* Open UTMP file. */
setutent ();
@@ -43,7 +43,7 @@ logout (const char *line)
strncpy (tmp.ut_line, line, sizeof tmp.ut_line);
/* Read the record. */
- if( (ut = getutline(&tmp)) )
+ if ((ut = getutline(&tmp)) != NULL)
{
/* Clear information about who & from where. */
memset (ut->ut_name, 0, sizeof ut->ut_name);
@@ -54,12 +54,12 @@ logout (const char *line)
# if !defined __WORDSIZE_COMPAT32 || __WORDSIZE_COMPAT32 == 0
gettimeofday (&ut->ut_tv, NULL);
# else
- {
- struct timeval tv;
- gettimeofday (&tv, NULL);
- ut->ut_tv.tv_sec = tv.tv_sec;
- ut->ut_tv.tv_usec = tv.tv_usec;
- }
+ {
+ struct timeval tv;
+ gettimeofday (&tv, NULL);
+ ut->ut_tv.tv_sec = tv.tv_sec;
+ ut->ut_tv.tv_usec = tv.tv_usec;
+ }
# endif
#else
time (&ut->ut_time);