From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <78aefbc0def962a55ca81ae3c6d20791@quanstro.net> From: erik quanstrom Date: Mon, 20 Jul 2009 21:01:46 -0400 To: 9fans@9fans.net In-Reply-To: <1248108802.18344.10034.camel@work.SFBay.Sun.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] i/o on a hangup channel asymmetry Topicbox-Message-UUID: 2961da30-ead5-11e9-9d60-3106f5b1d025 i did some looking through the plan 9 source. (it's great to have it all in one place.) all of this group, to a quick scan, should work if the note is removed. many can lose their note handlers, because the the pipe signal is the only there to catch writes on closed pipes. grep 'closed pipe' `{find . | grep '\.[chy]$'} ./9/port/devpipe.c: * a write to a closed pipe causes a note to be sent to ./9/port/devpipe.c: postnote(up, 1, "sys: write on closed pipe", NUser); ./9/port/devpipe.c: postnote(up, 1, "sys: write on closed pipe", NUser); ./ape/lib/ap/plan9/signal.c: {"sys: write on closed pipe", SIGPIPE}, ./cmd/con/con.c: if(strstr(msg, "closed pipe") ./cmd/sam/plan9.c: if(bpipeok && strcmp(s, "sys: write on closed pipe") == 0) ./cmd/srv.c: if(strstr(c, "write on closed pipe") == 0){ ./cmd/srv.c: fprint(2, "write on closed pipe\n"); ./cmd/unix/drawterm/kern/devpipe.c: * a write to a closed pipe causes a note to be sent to ./cmd/unix/drawterm/kern/devpipe.c: postnote(up, 1, "sys: write on closed pipe", NUser); ./cmd/unix/drawterm/kern/devpipe.c: postnote(up, 1, "sys: write on closed pipe", NUser); ./cmd/upas/common/libsys.c: * catch a write on a closed pipe ./cmd/upas/common/libsys.c: static char *foo = "sys: write on closed pipe"; ./cmd/upas/imap4d/imap4d.c: if(strstr(msg, "closed pipe") != nil) ./cmd/upas/smtp/smtp.c: if(strstr(msg, "closed pipe")){ ./cmd/upas/smtp/smtp.c: syslog(0, "smtp.fail", "%s closed pipe to %s", deliverytype(), farend); ./cmd/upas/smtp/smtp.c: /* call _exits() to prevent Bio from trying to flush closed pipe */ ./libauth/newns.c:static char *wocp = "sys: write on closed pipe"; needs fixing: ./cmd/sort.c: if(strncmp(s, "sys: write on closed pipe", 25) == 0) there's a write that is not checked for errors. this is already a bug. patch already submitted. - erik