1 --- ./tools/lvmcmdline.c
2 +++ ./tools/lvmcmdline.c
4 int err = is_valid_fd(STDERR_FILENO);
6 if (!is_valid_fd(STDIN_FILENO) &&
7 - !(stdin = fopen(_PATH_DEVNULL, "r"))) {
8 + !freopen(_PATH_DEVNULL, "r", stdin)) {
10 perror("stdin stream open");
15 if (!is_valid_fd(STDOUT_FILENO) &&
16 - !(stdout = fopen(_PATH_DEVNULL, "w"))) {
17 + !freopen(_PATH_DEVNULL, "w", stdout)) {
19 perror("stdout stream open");
24 if (!is_valid_fd(STDERR_FILENO) &&
25 - !(stderr = fopen(_PATH_DEVNULL, "w"))) {
26 + !freopen(_PATH_DEVNULL, "w", stderr)) {
27 printf("stderr stream open: %s\n",
30 --- ./lib/commands/toolcontext.c.orig
31 +++ ./lib/commands/toolcontext.c
33 /* FIXME Make this configurable? */
36 -#ifndef VALGRIND_POOL
37 +#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
38 /* Set in/out stream buffering before glibc */
40 /* Allocate 2 buffers */
43 dm_pool_destroy(cmd->libmem);
45 -#ifndef VALGRIND_POOL
46 +#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
47 if (cmd->linebuffer) {
48 /* Reset stream buffering to defaults */
49 if (is_valid_fd(STDIN_FILENO) &&