sam: clean up checkerrs (Rob Pike)
This commit is contained in:
parent
9f8a101a7c
commit
1412580357
1 changed files with 3 additions and 3 deletions
|
|
@ -142,13 +142,13 @@ plan9(File *f, int type, String *s, int nest)
|
||||||
void
|
void
|
||||||
checkerrs(void)
|
checkerrs(void)
|
||||||
{
|
{
|
||||||
char buf[4096];
|
char buf[BLOCKSIZE-10];
|
||||||
int f, n, nl;
|
int f, n, nl;
|
||||||
char *p;
|
char *p;
|
||||||
long l;
|
long l;
|
||||||
|
|
||||||
if(statfile(errfile, 0, 0, 0, &l, 0) > 0 && l != 0){
|
if(statfile(errfile, 0, 0, 0, &l, 0) > 0 && l != 0){
|
||||||
if((f=open((char *)errfile, 0)) != -1){
|
if((f=open(errfile, 0)) != -1){
|
||||||
if((n=read(f, buf, sizeof buf-1)) > 0){
|
if((n=read(f, buf, sizeof buf-1)) > 0){
|
||||||
for(nl=0,p=buf; nl<25 && p<&buf[n]; p++)
|
for(nl=0,p=buf; nl<25 && p<&buf[n]; p++)
|
||||||
if(*p=='\n')
|
if(*p=='\n')
|
||||||
|
|
@ -161,5 +161,5 @@ checkerrs(void)
|
||||||
close(f);
|
close(f);
|
||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
remove((char *)errfile);
|
remove(errfile);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue