Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jan 2010 21:27:06 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r201677 - user/ed/utmpx/lib/libc/gen
Message-ID:  <201001062127.o06LR6YK044644@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Wed Jan  6 21:27:06 2010
New Revision: 201677
URL: http://svn.freebsd.org/changeset/base/201677

Log:
  Respect the byte ordering of fu_tv.

Modified:
  user/ed/utmpx/lib/libc/gen/pututxline.c

Modified: user/ed/utmpx/lib/libc/gen/pututxline.c
==============================================================================
--- user/ed/utmpx/lib/libc/gen/pututxline.c	Wed Jan  6 21:22:29 2010	(r201676)
+++ user/ed/utmpx/lib/libc/gen/pututxline.c	Wed Jan  6 21:27:06 2010	(r201677)
@@ -163,7 +163,7 @@ utx_active_remove(struct futx *fu)
 			 * Prevent login sessions from having a negative
 			 * timespan.
 			 */
-			if (fu->fu_tv < fe.fu_tv)
+			if (be64toh(fu->fu_tv) < be64toh(fe.fu_tv))
 				fu->fu_tv = fe.fu_tv;
 
 			/* Terminate session. */
@@ -203,7 +203,7 @@ utx_lastlogin_add(const struct futx *fu)
 			continue;
 
 		/* Prevent lowering the time value. */
-		if (fu->fu_tv <= fe.fu_tv)
+		if (be64toh(fu->fu_tv) <= be64toh(fe.fu_tv))
 			goto done;
 		
 		/* Found a previous lastlogin entry for this user. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001062127.o06LR6YK044644>