Date: Wed, 23 May 2007 12:02:03 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Dag-Erling Smorgrav <des@FreeBSD.org> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libutil flopen.c Message-ID: <20070523100203.GB7428@garage.freebsd.pl> In-Reply-To: <200705230812.l4N8CZQi038702@repoman.freebsd.org> References: <200705230812.l4N8CZQi038702@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Wed, May 23, 2007 at 08:12:34AM +0000, Dag-Erling Smorgrav wrote: > des 2007-05-23 08:12:34 UTC > > FreeBSD src repository > > Modified files: > lib/libutil flopen.c > Log: > If (flags & O_TRUNC), don't truncate the file until we've successfully > locked it. > > MFC after: 3 weeks > > Revision Changes Path > 1.5 +11 -1 src/lib/libutil/flopen.c > > http://cvsweb.FreeBSD.org/src/lib/libutil/flopen.c.diff?r1=1.4&r2=1.5&f=h > --- src/lib/libutil/flopen.c 2007/05/10 15:01:42 1.4 > +++ src/lib/libutil/flopen.c 2007/05/23 08:12:34 1.5 > @@ -26,7 +26,7 @@ > */ > > #include <sys/cdefs.h> > -__FBSDID("$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/lib/libutil/flopen.c,v 1.4 2007/05/10 15:01:42 des Exp $"); > +__FBSDID("$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/lib/libutil/flopen.c,v 1.5 2007/05/23 08:12:34 des Exp $"); > > #include <sys/file.h> > #include <sys/stat.h> > @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD: /usr/local/www/cvsro > int > flopen(const char *path, int flags, ...) > { > - int fd, operation, serrno; > + int fd, operation, serrno, truncate; > struct stat sb, fsb; > mode_t mode; > > @@ -62,6 +62,9 @@ flopen(const char *path, int flags, ...) > if (flags & O_NONBLOCK) > operation |= LOCK_NB; > > + truncate = (flags & O_TRUNC); > + flags |= ~O_TRUNC; flags &= ~O_TRUNC ? -- Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGVBEbForvXbEpPzQRAv6dAJ9NalVojDTK2RSY8UwQdzrSxSwCiwCeKyzA 3kX4M8gqBtevdeLU6Ou5Y28= =GrPz -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070523100203.GB7428>
