Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jun 2007 20:30:39 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Roman Divacky <rdivacky@FreeBSD.org>
Cc:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   Re: PERFORCE change 122077 for review
Message-ID:  <20070627183039.GC4821@garage.freebsd.pl>
In-Reply-To: <200706211001.l5LA16H4021185@repoman.freebsd.org>
References:  <200706211001.l5LA16H4021185@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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

On Thu, Jun 21, 2007 at 10:01:06AM +0000, Roman Divacky wrote:
> http://perforce.freebsd.org/chv.cgi?CH=3D122077
>=20
> Change 122077 by rdivacky@rdivacky_witten on 2007/06/21 10:00:59
>=20
> 	Introduce kern_absolute_path which checks whether a given path is absolu=
te or
> 	not by checking first char for being '/'.
> =09
> 	Use this function to implement BADF semantic of *at syscalls.
[...]
> +/* Check whether a path is an absolute path. */
> +static int kern_absolute_path(char *path, enum uio_seg pathseg)
> +{
> +	int error, len;
> +	char buf[PATH_MAX];
> +
> +	if (pathseg =3D=3D UIO_SYSSPACE) {
> +		return (path[0] =3D=3D '/');	=09
> +	} else {
> +		error =3D copyinstr(path, buf, PATH_MAX, &len);
> +		if (error)
> +			return 1;	/* we want to fail */

When you cannot copy the data do you really want to return TRUE?

> +		return (buf[0] =3D=3D '/');=09
> +	}
> +}

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

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

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

iD8DBQFGgqzPForvXbEpPzQRAhFvAJ4xFx5gYTm/dOCcV6Mhj6jTc/XpeACg2YMg
Q5s4iVSBuRNsh1ZbAGUBkGk=
=9fr8
-----END PGP SIGNATURE-----

--W5WqUoFLvi1M7tJE--



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