buildFHSEnv: void ldconfig warnings
This commit is contained in:
parent
01fdad87c4
commit
756c907d41
@ -1,5 +1,6 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
#include <spawn.h>
|
#include <spawn.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -34,11 +35,15 @@ int main(int, const char *argv[]) {
|
|||||||
pid_t pid;
|
pid_t pid;
|
||||||
const char *ldconfig_argv[] = {"/bin/ldconfig", NULL};
|
const char *ldconfig_argv[] = {"/bin/ldconfig", NULL};
|
||||||
char *ldconfig_envp[] = {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))) {
|
(char *const *)ldconfig_argv, ldconfig_envp))) {
|
||||||
fprintf(stderr, "Failed to run ldconfig: %s\n", strerror(e));
|
fprintf(stderr, "Failed to run ldconfig: %s\n", strerror(e));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
posix_spawn_file_actions_destroy(&action);
|
||||||
|
|
||||||
int status;
|
int status;
|
||||||
if (waitpid(pid, &status, 0) == -1) {
|
if (waitpid(pid, &status, 0) == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user