plan 9 kernel history: overview | file list | diff list

1991/0221/port/sysfile.c (diff list | history)

1990/1210/sys/src/9/port/sysfile.c:106,1141991/0221/sys/src/9/port/sysfile.c:106,118 (short | long | prev | next)
Bug fix: check for invalid file descriptors.
rsc Fri Mar 4 17:11:41 2005
1990/0227    
	 */ 
	c = fdtochan(arg[0], -1); 
	fd = arg[1]; 
	if(fd != -1) 
1991/0221    
	if(fd != -1){ 
		if(fd<0 || NFD<=fd) 
			error(Ebadfd); 
		if(fd > u->maxfd) 
			u->maxfd = fd; 
1990/0227    
		oc = u->fd[fd]; 
	else{ 
1991/0221    
	}else{ 
1990/0227    
		oc = 0; 
		fd = newfd(); 
	} 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)