From 756c907d41e8d0ee3a8a7828565e10afbfbe6837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 12 Nov 2024 21:18:09 +0100 Subject: [PATCH] buildFHSEnv: void ldconfig warnings --- .../build-fhsenv-bubblewrap/container-init.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/container-init.cc b/pkgs/build-support/build-fhsenv-bubblewrap/container-init.cc index 351e92477a08..82c1cb57ed5a 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/container-init.cc +++ b/pkgs/build-support/build-fhsenv-bubblewrap/container-init.cc @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -34,11 +35,15 @@ int main(int, const char *argv[]) { pid_t pid; const char *ldconfig_argv[] = {"/bin/ldconfig", NULL}; char *ldconfig_envp[] = {NULL}; - if ((e = posix_spawn(&pid, ldconfig_argv[0], NULL, NULL, + posix_spawn_file_actions_t action; + posix_spawn_file_actions_init(&action); + posix_spawn_file_actions_addopen (&action, STDERR_FILENO, "/dev/null", O_WRONLY|O_APPEND, 0); + if ((e = posix_spawn(&pid, ldconfig_argv[0], &action, NULL, (char *const *)ldconfig_argv, ldconfig_envp))) { fprintf(stderr, "Failed to run ldconfig: %s\n", strerror(e)); return 1; } + posix_spawn_file_actions_destroy(&action); int status; if (waitpid(pid, &status, 0) == -1) {