Skip site navigation (1)Skip section navigation (2)
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

--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, May 23, 2007 at 08:12:34AM +0000, Dag-Erling Smorgrav wrote:
> des         2007-05-23 08:12:34 UTC
>=20
>   FreeBSD src repository
>=20
>   Modified files:
>     lib/libutil          flopen.c=20
>   Log:
>   If (flags & O_TRUNC), don't truncate the file until we've successfully
>   locked it.
>  =20
>   MFC after:      3 weeks
>  =20
>   Revision  Changes    Path
>   1.5       +11 -1     src/lib/libutil/flopen.c
>=20
> http://cvsweb.FreeBSD.org/src/lib/libutil/flopen.c.diff?r1=3D1.4&r2=3D1.5=
&f=3Dh
> --- 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 @@
>   */
> =20
>  #include <sys/cdefs.h>
> -__FBSDID("$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/lib/libutil/flope=
n.c,v 1.4 2007/05/10 15:01:42 des Exp $");
> +__FBSDID("$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/lib/libutil/flope=
n.c,v 1.5 2007/05/23 08:12:34 des Exp $");
> =20
>  #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;
> =20
> @@ -62,6 +62,9 @@ flopen(const char *path, int flags, ...)
>  	if (flags & O_NONBLOCK)
>  		operation |=3D LOCK_NB;
> =20
> +	truncate =3D (flags & O_TRUNC);
> +	flags |=3D ~O_TRUNC;

flags &=3D ~O_TRUNC ?

--=20
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--qDbXVdCdHGoSgWSk
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)

iD8DBQFGVBEbForvXbEpPzQRAv6dAJ9NalVojDTK2RSY8UwQdzrSxSwCiwCeKyzA
3kX4M8gqBtevdeLU6Ou5Y28=
=GrPz
-----END PGP SIGNATURE-----

--qDbXVdCdHGoSgWSk--



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