Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 2010 14:43:35 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r202152 - user/ed/utmpx/lib/libc/gen
Message-ID:  <201001121443.o0CEhZ9i015225@svn.freebsd.org>

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



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