chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Interaction of subprocess and condition handling


From: Lassi Kortela
Subject: [Chicken-users] Interaction of subprocess and condition handling
Date: Thu, 18 Jul 2019 21:53:03 +0300
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

How do you handle errors signaled by the 'process' procedure from the (chicken process) module in Chicken 5?

When I try things like

  (receive (from-child to-child child)
      (condition-case
          (process command args)
        (_ ()
           (values #f #f #f)))
    ...)

I get weird results - I have some 'display' calls, and according to 'current-process-id' some of them are coming from a different PID (I assume 'process' does fork/exec internally, so somehow some of the display code actually ends up running in the forked child process.

I guess normally the unix execve() call succeeds so the child process stops running the Chicken programs and executes the desired command. But when execve() fails (e.g. due to a missing executable file) then the child process continues running Chicken code instead of exiting?



reply via email to

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