chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Weird behaviour in process / output / close-output-p


From: Hans Bulfone
Subject: Re: [Chicken-users] Weird behaviour in process / output / close-output-port
Date: Thu, 1 Jun 2006 21:24:58 +0200
User-agent: Mutt/1.5.9i

hi,

On Thu, Jun 01, 2006 at 12:05:07PM -0500, Alejandro Forero Cuervo wrote:
> > I can't reproduce this problem. I'll get lots of error
> > messages and finally a "too many open files".
> 
> Maybe its because of the (hypothetical) race condition?
> What happens if you (sleep 1) before (newline out), as in the
> following?
> 
>     (use posix)
> 
>     (let loop ()
>       (receive (in out pid)
>                (process "foo")
>         (sleep 1)
>         (newline out))
>       (loop))

$ ./proctest.scm ; echo $?
bash: line 1: foo: command not found
141

imho this is normal on unix.
the shell trying to execute "foo" has already terminated when
you call (newline out), so you get a SIGPIPE signal which
terminates the process if it's not handled or ignored.

the bash manpage says:

When a command terminates  on  a  fatal
signal N, bash uses the value of 128+N as the exit status.

SIGPIPE is 13 on my system, that's why the "exit status" is 141.

bye,
hans.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]