win: better SIGPIPE handling
This commit is contained in:
parent
e465991ea6
commit
65a34c7fac
1 changed files with 9 additions and 10 deletions
|
|
@ -93,15 +93,6 @@ usage(void)
|
||||||
threadexitsall("usage");
|
threadexitsall("usage");
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
nopipes(void *v, char *msg)
|
|
||||||
{
|
|
||||||
USED(v);
|
|
||||||
if(strcmp(msg, "sys: write on closed pipe") == 0)
|
|
||||||
return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
waitthread(void *v)
|
waitthread(void *v)
|
||||||
{
|
{
|
||||||
|
|
@ -157,7 +148,15 @@ threadmain(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
notedisable("sys: write on closed pipe");
|
/*
|
||||||
|
* notedisable("sys: write on closed pipe");
|
||||||
|
* not okay to disable the note, because that
|
||||||
|
* gets inherited by the subshell, so that something
|
||||||
|
* as simple as "yes | sed 10q" never exits.
|
||||||
|
* call notifyoff instead. (is notedisable ever safe?)
|
||||||
|
*/
|
||||||
|
notifyoff("sys: write on closed pipe");
|
||||||
|
|
||||||
noteenable("sys: child");
|
noteenable("sys: child");
|
||||||
notify(hangupnote);
|
notify(hangupnote);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue