[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dwww: cat and file (pipe race condition)



Andrew Pimlott <andrew@pimlott.ne.mediaone.net> writes:

> I just read this one message so I don't know what the original
> problem is.  However, I think you are misdiagnosing or misexplaining
> this.  The SIGPIPE goes to and only to $process.  The reason is that
> file closes its stdin as soon as it has ready a few bytes, with the
> result that $process then has nowhere to write.  cat cannot get a
> SIGPIPE because it is writing to /dev/null, which rarely stops
> accepting bits.

Yes, you are missing context.  The cat process which I refer to as
getting the SIGPIPE is what I call $process here.  The context is
inside one part of dwww, which has a commandline like 
$process | file | magic2mime
, and the process variable is almost always a cat process.  This cat
process appears to be hanging somehow, and my use of subprocesses with 
parens was an attempt to try something to make the whole pipeline not
hang, as somehow I suspected that the original cat process isn't
getting the SIGPIPE it should.


Reply to: