From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from cse.psu.edu ([130.203.3.50]) by hawkwind.utcs.utoronto.ca with SMTP id <23978>; Sun, 12 Jan 1997 18:39:49 -0500 Received: from vorlon.cse.psu.edu (schwartz@vorlon.cse.psu.edu [130.203.30.21]) by cse.psu.edu (8.7.5/8.7.3) with ESMTP id SAA03560; Sun, 12 Jan 1997 18:40:16 -0500 (EST) From: Scott Schwartz Received: (from schwartz@localhost) by vorlon.cse.psu.edu (8.7.6/8.7.3) id SAA08864; Sun, 12 Jan 1997 18:39:16 -0500 (EST) Date: Sun, 12 Jan 1997 18:39:16 -0500 Message-Id: <199701122339.SAA08864@vorlon.cse.psu.edu> To: byron@netapp.com, rc@hawkwind.utcs.toronto.edu Subject: Re: intr and RC I am not sure what this bug is but the bug that last bit me with Solaris and which I consider a showstopper is this: rsh solaris-machine ls The last time I ran this command rc would hang after running ls, because rc on the solaris machine was getting no child pids back from wait(). I can't reproduce that, with a recent version of solaris. % uname -a SunOS vorlon.cse.psu.edu 5.5.1 Generic_103640-03 sun4m sparc SUNW,SPARCstation-4 % cc -V cc: SC4.0 18 Oct 1995 C 4.0 Here are all the changes I've made to the distributed code: % rcsdiff -c RCS/* *** /tmp/T0a00295 Sun Jan 12 18:29:27 1997 --- Makefile Fri May 31 02:08:02 1996 *************** *** 16,28 **** #ADDON=addon.o # Use an ANSI compiler (or at least one that groks prototypes and void *): ! CC=gcc -g -O ! CFLAGS= LDFLAGS= # You may substitute "bison -y" for yacc. (You want to choose the one that # makes a smaller y.tab.c. Also see the README about Sun's yacc.) ! YACC=yacc OBJS=$(ADDON) builtins.o except.o exec.o $(EXECVE) fn.o footobar.o getopt.o \ glob.o glom.o hash.o heredoc.o input.o lex.o list.o main.o match.o \ --- 16,30 ---- #ADDON=addon.o # Use an ANSI compiler (or at least one that groks prototypes and void *): ! CC=cc ! # -cg92 ! #CC=insight ! CFLAGS= -O -fast -DSYSVR4 LDFLAGS= # You may substitute "bison -y" for yacc. (You want to choose the one that # makes a smaller y.tab.c. Also see the README about Sun's yacc.) ! YACC=bison -y OBJS=$(ADDON) builtins.o except.o exec.o $(EXECVE) fn.o footobar.o getopt.o \ glob.o glom.o hash.o heredoc.o input.o lex.o list.o main.o match.o \ No differences encountered *** /tmp/T0a00295 Sun Jan 12 18:29:27 1997 --- footobar.c Fri May 31 01:45:46 1996 *************** *** 9,15 **** #ifdef PROTECT_ENV static bool Fconv(Format *f, int ignore) { ! unsigned const char *s = va_arg(f->args, unsigned const char *); int c; while ((c = *s++) != '\0') --- 9,15 ---- #ifdef PROTECT_ENV static bool Fconv(Format *f, int ignore) { ! const unsigned char *s = va_arg(f->args, const unsigned char *); int c; while ((c = *s++) != '\0') *** /tmp/T0a00295 Sun Jan 12 18:29:27 1997 --- input.c Fri May 31 01:45:47 1996 *************** *** 140,145 **** --- 140,147 ---- long /*ssize_t*/ r = rc_read(istack->fd, inbuf + 2, BUFSIZE); sigchk(); if (r < 0) { + if (errno == EINTR) /*retry interrupted read*/ + continue; uerror("read"); rc_exit(1); } *** /tmp/T0a00295 Sun Jan 12 18:29:28 1997 --- print.c Fri May 31 01:45:44 1996 *************** *** 219,225 **** */ extern void fmtappend(Format *format, const char *s, SIZE_T len) { ! while (format->buf + len > format->bufend) { SIZE_T split = format->bufend - format->buf; memcpy(format->buf, s, split); format->buf += split; --- 219,225 ---- */ extern void fmtappend(Format *format, const char *s, SIZE_T len) { ! while (len > format->bufend - format->buf) { SIZE_T split = format->bufend - format->buf; memcpy(format->buf, s, split); format->buf += split; *************** *** 240,246 **** */ extern int printfmt(Format *format, const char *fmt) { ! unsigned const char *s = (unsigned const char *) fmt; if (fmttab[0] == NULL) inittab(); --- 240,246 ---- */ extern int printfmt(Format *format, const char *fmt) { ! const unsigned char *s = (const unsigned char *) fmt; if (fmttab[0] == NULL) inittab(); *************** *** 314,319 **** --- 314,320 ---- static void memprint_grow(Format *format, SIZE_T more) { char *buf; + SIZE_T pos = format->buf - format->bufbegin; SIZE_T len = format->bufend - format->bufbegin + 1; len = (len >= more) ? len * 2 *************** *** 325,331 **** buf = nalloc(len); memcpy(buf, format->bufbegin, used); } ! format->buf = buf + (format->buf - format->bufbegin); format->bufbegin = buf; format->bufend = buf + len - 1; } --- 326,332 ---- buf = nalloc(len); memcpy(buf, format->bufbegin, used); } ! format->buf = buf + pos; format->bufbegin = buf; format->bufend = buf + len - 1; } *** /tmp/T0a00295 Sun Jan 12 18:29:29 1997 --- signal.c Fri May 31 01:45:50 1996 *************** *** 66,72 **** void (*h)(int); int i; for (i = 1; i < NUMOFSIGNALS; i++) { ! if ((h = signal(i, SIG_DFL)) != SIG_DFL) signal(i, h); sighandlers[i] = h; } --- 66,73 ---- void (*h)(int); int i; for (i = 1; i < NUMOFSIGNALS; i++) { ! h = signal(i, SIG_DFL); ! if (h != SIG_ERR && h != SIG_DFL) signal(i, h); sighandlers[i] = h; }