generator: fix file descriptor leak
PATCH 1/1 generator: fix file descriptor leak
Set close-on-exec flag for kmsg file descriptor, so that _error() can be used in case of execve() failure.
Signed-off-by Topi Miettinen <[email protected]>
--- scripts/lvm2_activation_generator_systemd_red_hat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lvm2_activation_generator_systemd_red_hat.c +1 -1
@@ -23,7 +23,7 @@ static int _kmsg_fd;static void _log_init (void ) {// failing is harmless - _kmsg_fd =open (KMSG_DEV_PATH ,O_WRONLY |O_NOCTTY ); + _kmsg_fd =open (KMSG_DEV_PATH ,O_WRONLY |O_NOCTTY |O_CLOEXEC ); }static void _log_exit (void )
Signature · 1 line
2.24.0