2009-08-26 12:03:55 +00:00
|
|
|
| From: David Korn <dgk@research.att.com>
|
|
|
|
| To: werner@suse.de
|
|
|
|
| Subject: Re: Re: [ast-users] Crash with SIGPIPE trap...
|
|
|
|
|
|
|
|
|
| OK, now I get what is causing this. Here is a simpler fix
|
|
|
|
| that I think should work. If the stream is in a pool, then
|
|
|
|
| this just purges the top level so that it doesn't write to
|
|
|
|
| that level.
|
|
|
|
|
|
2009-08-24 14:23:50 +00:00
|
|
|
--- src/cmd/ksh93/sh/fault.c
|
|
|
|
+++ src/cmd/ksh93/sh/fault.c 2009-08-24 15:52:21.770401660 +0200
|
2009-08-26 12:03:55 +00:00
|
|
|
@@ -413,6 +413,9 @@ void sh_chktrap(void)
|
2009-08-24 14:23:50 +00:00
|
|
|
sh.sigflag[sig] &= ~SH_SIGTRAP;
|
|
|
|
if(trap=sh.st.trapcom[sig])
|
|
|
|
{
|
2009-08-26 12:03:55 +00:00
|
|
|
+ Sfio_t *fp;
|
|
|
|
+ if (sig==SIGPIPE && (fp=sfpool((Sfio_t*)0,sh.outpool,SF_WRITE)))
|
|
|
|
+ sfpurge(fp);
|
2009-08-24 14:23:50 +00:00
|
|
|
sh.oldexit = SH_EXITSIG|sig;
|
|
|
|
sh_trap(trap,0);
|
|
|
|
}
|