Files
lightning/lightningd
ZmnSCPxj jxPCSnmZ 5356267f15 *: Use new closefrom module from ccan.
This also inadvertently fixes a latent bug: before this patch, in the
`subd` function in `lightningd/subd.c`, we would close `execfail[1]`
*before* doing an `exec`.
We use an EOF on `execfail[1]` as a signal that `exec` succeeded (the
fd is marked CLOEXEC), and otherwise use it to pump `errno` to the
parent.
The intent is that this fd should be kept open until `exec`, at which
point CLOEXEC triggers and close that fd and sends the EOF, *or* if
`exec` fails we can send the `errno` to the parent process vua that
pipe-end.

However, in the previous version, we end up closing that fd *before*
reaching `exec`, either in the loop which `dup2`s passed-in fds (by
overwriting `execfail[1]` with a `dup2`) or in the "close everything"
loop, which does not guard against `execfail[1]`, only
`dev_disconnect_fd`.
2021-10-22 13:17:37 +02:00
..
2021-10-15 12:09:36 +02:00
2021-10-15 12:09:36 +02:00
2021-10-15 12:09:36 +02:00
2021-10-15 12:09:36 +02:00
2021-10-15 12:09:36 +02:00
2021-10-15 12:09:36 +02:00
2021-10-15 12:09:36 +02:00
2021-10-13 13:41:18 +10:30
2021-10-13 13:41:18 +10:30
2021-10-15 12:09:36 +02:00
2021-10-15 12:09:36 +02:00
2021-10-15 12:09:36 +02:00
2021-10-15 12:09:36 +02:00
2021-10-13 13:41:18 +10:30
2021-10-22 13:17:37 +02:00
2021-10-15 12:09:36 +02:00
2021-10-15 12:09:36 +02:00