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

1992/0610/boot/aux.c (diff list | history)

1992/0609/sys/src/9/boot/aux.c:71,841992/0610/sys/src/9/boot/aux.c:71,82 (short | long | prev | next)
1992/0317    
} 
 
int 
readenv(char *name, char *buf, int len) 
1992/0610    
readfile(char *name, char *buf, int len) 
1992/0317    
{ 
	int f, n; 
	char ename[2*NAMELEN]; 
 
	sprint(ename, "#e/%s", name); 
	buf[0] = 0; 
	f = open(ename, OREAD); 
1992/0610    
	f = open(name, OREAD); 
1992/0317    
	if(f < 0) 
		return -1; 
	n = read(f, buf, len-1); 
1992/0609/sys/src/9/boot/aux.c:146,1561992/0610/sys/src/9/boot/aux.c:144,161
1992/0317    
	return n; 
} 
1992/0530    
 
1992/0610    
/* 
 *  get second word of the terminal environment variable.   If it 
 *  ends in "boot", get work of that part. 
 */ 
1992/0530    
void 
getconffile(char *conffile, char *terminal) 
{ 
	char *p, *q; 
1992/0610    
	char *s; 
	int n; 
1992/0530    
 
1992/0610    
	s = conffile; 
1992/0530    
	*conffile = 0; 
	p = terminal; 
	if((p = strchr(p, ' ')) == 0 || p[1] == ' ' || p[1] == 0) 
1992/0609/sys/src/9/boot/aux.c:160,1631992/0610/sys/src/9/boot/aux.c:165,174
1992/0530    
		; 
	while(p < q) 
		*conffile++ = *p++; 
1992/0610    
	*conffile = 0; 
 
	/* dump a trailig boot */ 
	n = strlen(s); 
	if(n > 4 && strcmp(s + n - 4, "boot") == 0) 
		*(s+n-4) = 0; 
1992/0530    
} 


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