getcwd.diff

Anonymous, 06/04/2009 02:00 PM

Download (965 Bytes)

View differences:

sys/kern/vfs_cache.c
2382 2382
		return (ENODEV);
2383 2383

  
2384 2384
	buflen = uap->buflen;
2385
	if (buflen < 2)
2385
	if (buflen == 0)
2386 2386
		return (EINVAL);
2387 2387
	if (buflen > MAXPATHLEN)
2388 2388
		buflen = MAXPATHLEN;
......
2431 2431
		for (i = nch.ncp->nc_nlen - 1; i >= 0; i--) {
2432 2432
			if (bp == buf) {
2433 2433
				numcwdfail4++;
2434
				*error = ENOMEM;
2434
				*error = ERANGE;
2435 2435
				return(NULL);
2436 2436
			}
2437 2437
			*--bp = nch.ncp->nc_name[i];
2438 2438
		}
2439 2439
		if (bp == buf) {
2440 2440
			numcwdfail4++;
2441
			*error = ENOMEM;
2441
			*error = ERANGE;
2442 2442
			return(NULL);
2443 2443
		}
2444 2444
		*--bp = '/';
......
2458 2458
	if (!slash_prefixed) {
2459 2459
		if (bp == buf) {
2460 2460
			numcwdfail4++;
2461
			*error = ENOMEM;
2461
			*error = ERANGE;
2462 2462
			return(NULL);
2463 2463
		}
2464 2464
		*--bp = '/';