tFix rc not to bus error on Mac OS X. Don't print about child notes either. - plan9port - [fork] Plan 9 from user space (HTM) git clone git://src.adamsgaard.dk/plan9port (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit 0b917997919b470edc949b0cf7af62f160885f5e (DIR) parent 1ae0de511a26ab944bccf7eba89c3718697cd366 (HTM) Author: rsc <devnull@localhost> Date: Thu, 4 Mar 2004 02:36:36 +0000 Fix rc not to bus error on Mac OS X. Don't print about child notes either. Diffstat: M src/cmd/rc/io.c | 7 ++++++- M src/cmd/rc/io.h | 6 ++++++ M src/cmd/rc/plan9ish.c | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) --- (DIR) diff --git a/src/cmd/rc/io.c b/src/cmd/rc/io.c t@@ -126,10 +126,13 @@ void flush(io *f) } } io *openfd(int fd){ - io *f=new(struct io); + io *f; +fprint(2, "in openfd\n"); + f=new(struct io); f->fd=fd; f->bufp=f->ebuf=f->buf; f->strp=0; +fprint(2, "in openfd\n"); return f; } io *openstr(void){ t@@ -155,6 +158,7 @@ io *opencore(char *s, int len) Memcpy(buf, s, len); return f; } +/* void rewind(io *io) { if(io->fd==-1) io->bufp=io->strp; t@@ -163,6 +167,7 @@ void rewind(io *io) Seek(io->fd, 0L, 0); } } +*/ void closeio(io *io) { if(io->fd>=0) close(io->fd); (DIR) diff --git a/src/cmd/rc/io.h b/src/cmd/rc/io.h t@@ -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 NBUF 512 struct io{ (DIR) diff --git a/src/cmd/rc/plan9ish.c b/src/cmd/rc/plan9ish.c t@@ -400,8 +400,8 @@ notifyf(void *unused0, char *s) if(strncmp(s, "sys: ", 5)!=0) interrupted=1; goto Out; } - - pfmt(err, "rc: note: %s\n", s); + if(strcmp(s, "sys: child") != 0) + pfmt(err, "rc: note: %s\n", s); noted(NDFLT); return; Out: