[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Preventing file descriptor leak to execl'd processes
From: |
Maxime Devos |
Subject: |
Re: Preventing file descriptor leak to execl'd processes |
Date: |
Sat, 06 Mar 2021 19:04:05 +0100 |
User-agent: |
Evolution 3.34.2 |
On Sat, 2021-03-06 at 17:55 +0100, Marius Bakke wrote:
> Hello Guilers,
>
> [...]
>
> It works great, except that the script filename (/tmp/test-shell) has
> an open file descriptor which leaks into the new process:
>
> [...]
>
> I've managed to work around it by setting FD_CLOEXEC on it:
>
> [code using port-for-each and port-filename]
>
> But it seems heavy-handed. Is there an easier way to access the "script
> port"? Perhaps Guile itself should make it FD_CLOEXEC by default?
Easy way to access the ‘script port’: the Scheme procedure current-load-port.
Take a look at the output of the attached script.
Greetings,
Maxime
script.scm
Description: Text Data
signature.asc
Description: This is a digitally signed message part