From: Collin Funk Date: Thu, 23 Oct 2025 19:35:37 +0000 (-0700) Subject: split: cleanup after posix_spawn X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2213542e400e2008e02f1b18232e17a3d7ab112e;p=thirdparty%2Fcoreutils.git 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. --- 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;