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

Ed Schouten ed at FreeBSD.org
Tue Jan 12 14:43:35 UTC 2010


Author: ed
Date: Tue Jan 12 14:43:34 2010
New Revision: 202152
URL: http://svn.freebsd.org/changeset/base/202152

Log:
  According to lockf(3):
  
  	File locks are released on first close by the locking process of
  	any file descriptor for the file.
  
  No need to call it then.

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 13:45:40 2010	(r202151)
+++ user/ed/utmpx/lib/libc/gen/pututxline.c	Tue Jan 12 14:43:34 2010	(r202152)
@@ -104,7 +104,6 @@ utx_active_add(const struct futx *fu)
 		lseek(fd, partial, SEEK_SET);
 exact:
 	_write(fd, fu, sizeof *fu);
-	lockf(fd, F_ULOCK, 0);
 	_close(fd);
 }
 
@@ -142,13 +141,11 @@ utx_active_remove(struct futx *fu)
 			/* Terminate session. */
 			lseek(fd, -sizeof fe, SEEK_CUR);
 			_write(fd, fu, sizeof *fu);
-			lockf(fd, F_ULOCK, 0);
 			_close(fd);
 			return (0);
 		}
 	}
 
-	lockf(fd, F_ULOCK, 0);
 	_close(fd);
 	return (1);
 }
@@ -192,7 +189,6 @@ utx_lastlogin_add(const struct futx *fu)
 	}
 	_write(fd, fu, sizeof *fu);
 done:
-	lockf(fd, F_ULOCK, 0);
 	_close(fd);
 }
 


More information about the svn-src-user mailing list