Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 2010 10:06:32 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r202148 - user/ed/utmpx/lib/libc/gen
Message-ID:  <201001121006.o0CA6Wgf050251@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 		}
 	}



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