Fix rc not to bus error on Mac OS X.

Don't print about child notes either.
This commit is contained in:
rsc 2004-03-04 02:36:36 +00:00
parent 1ae0de511a
commit 0b91799791
3 changed files with 14 additions and 3 deletions

View file

@ -126,10 +126,13 @@ void flush(io *f)
} }
} }
io *openfd(int fd){ io *openfd(int fd){
io *f=new(struct io); io *f;
fprint(2, "in openfd\n");
f=new(struct io);
f->fd=fd; f->fd=fd;
f->bufp=f->ebuf=f->buf; f->bufp=f->ebuf=f->buf;
f->strp=0; f->strp=0;
fprint(2, "in openfd\n");
return f; return f;
} }
io *openstr(void){ io *openstr(void){
@ -155,6 +158,7 @@ io *opencore(char *s, int len)
Memcpy(buf, s, len); Memcpy(buf, s, len);
return f; return f;
} }
/*
void rewind(io *io) void rewind(io *io)
{ {
if(io->fd==-1) io->bufp=io->strp; if(io->fd==-1) io->bufp=io->strp;
@ -163,6 +167,7 @@ void rewind(io *io)
Seek(io->fd, 0L, 0); Seek(io->fd, 0L, 0);
} }
} }
*/
void closeio(io *io) void closeio(io *io)
{ {
if(io->fd>=0) close(io->fd); if(io->fd>=0) close(io->fd);

View file

@ -1,3 +1,9 @@
/*
* on Mac OS X, err is something else,
* and assigning to it causes a bus error.
* what a crappy linker.
*/
#define err rc_err
#define EOF (-1) #define EOF (-1)
#define NBUF 512 #define NBUF 512
struct io{ struct io{

View file

@ -400,8 +400,8 @@ notifyf(void *unused0, char *s)
if(strncmp(s, "sys: ", 5)!=0) interrupted=1; if(strncmp(s, "sys: ", 5)!=0) interrupted=1;
goto Out; goto Out;
} }
if(strcmp(s, "sys: child") != 0)
pfmt(err, "rc: note: %s\n", s); pfmt(err, "rc: note: %s\n", s);
noted(NDFLT); noted(NDFLT);
return; return;
Out: Out: