svn commit: r202148 - user/ed/utmpx/lib/libc/gen

Ed Schouten ed at FreeBSD.org
Tue Jan 12 10:06:32 UTC 2010


Author: ed
Date: Tue Jan 12 10:06:32 2010
New Revision: 202148
URL: http://svn.freebsd.org/changeset/base/202148

Log:
  Fix an off-by-one introduced in the previous commit.
  
  When receiving a partial match, we should overwrite the record itself.
  Because we call lseek() afterwards, we get the offset of the next to it.

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	Tue Jan 12 09:55:25 2010	(r202147)
+++ user/ed/utmpx/lib/libc/gen/pututxline.c	Tue Jan 12 10:06:32 2010	(r202148)
@@ -91,7 +91,7 @@ utx_active_add(const struct futx *fu)
 		default:
 			/* Allow us to overwrite unused records. */
 			if (partial == -1)
-				partial = lseek(fd, 0, SEEK_CUR);
+				partial = lseek(fd, 0, SEEK_CUR) - sizeof fe;
 			break;
 		}
 	}


More information about the svn-src-user mailing list