PERFORCE change 122077 for review

Pawel Jakub Dawidek pjd at FreeBSD.org
Wed Jun 27 18:30:57 UTC 2007


On Thu, Jun 21, 2007 at 10:01:06AM +0000, Roman Divacky wrote:
> http://perforce.freebsd.org/chv.cgi?CH=122077
> 
> Change 122077 by rdivacky at rdivacky_witten on 2007/06/21 10:00:59
> 
> 	Introduce kern_absolute_path which checks whether a given path is absolute or
> 	not by checking first char for being '/'.
> 	
> 	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 == UIO_SYSSPACE) {
> +		return (path[0] == '/');		
> +	} else {
> +		error = 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] == '/');	
> +	}
> +}

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/p4-projects/attachments/20070627/6987540e/attachment.pgp


More information about the p4-projects mailing list