From 2213542e400e2008e02f1b18232e17a3d7ab112e Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Thu, 23 Oct 2025 12:35:37 -0700 Subject: [PATCH] split: cleanup after posix_spawn * boostrap.conf (gnulib_modules): Add posix_spawn_file_actions_destroy. * src/split.c (cleanup): Call posix_spawnattr_destroy and posix_spawn_file_actions_destroy after a successful posix_spawn. --- bootstrap.conf | 1 + src/split.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/bootstrap.conf b/bootstrap.conf index fdab0725f1..4d401d2eb5 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -220,6 +220,7 @@ gnulib_modules=" posix_spawnattr_setsigdefault posix_spawn_file_actions_addclose posix_spawn_file_actions_adddup2 + posix_spawn_file_actions_destroy posix_spawn_file_actions_init posix_spawnp posixtm diff --git a/src/split.c b/src/split.c index 077e30f0d7..3d15091139 100644 --- a/src/split.c +++ b/src/split.c @@ -561,6 +561,9 @@ create (char const *name) error (EXIT_FAILURE, errno, _("failed to run command: \"%s -c %s\""), shell_prog, filter_command); + posix_spawnattr_destroy (&attr); + posix_spawn_file_actions_destroy (&actions); + if (close (fd_pair[0]) != 0) error (EXIT_FAILURE, errno, _("failed to close input pipe")); filter_pid = child_pid; -- 2.47.3