From d41afadaccfc0e912619c316beb6bb3d5ded6bf7 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 23 Jun 2019 08:56:28 +0300 Subject: [PATCH] lvm2: Added another musl patch. --- core/lvm2/build | 1 + core/lvm2/checksums | 1 + core/lvm2/patches/fix-stdio-usage.patch | 49 +++++++++++++++++++++++++ core/lvm2/sources | 1 + 4 files changed, 52 insertions(+) create mode 100644 core/lvm2/patches/fix-stdio-usage.patch diff --git a/core/lvm2/build b/core/lvm2/build index 7959a692..0d5a3af1 100755 --- a/core/lvm2/build +++ b/core/lvm2/build @@ -1,6 +1,7 @@ #!/bin/sh -e patch -p1 < portability.patch +patch -p1 < fix-stdio-usage.patch ./configure \ --prefix=/usr \ diff --git a/core/lvm2/checksums b/core/lvm2/checksums index cd63ed34..f2031178 100644 --- a/core/lvm2/checksums +++ b/core/lvm2/checksums @@ -1,2 +1,3 @@ d12da937ce5c0753d4ea8b5215afaa3b12061ea961268693e24e81b19918f514 LVM2.2.02.184.tgz d1f78c5a07f0ba66856e00e498c0f62164cabbcd9f0d9abcda1c25501eb235ff portability.patch +a15546fefd675fd6282683e93b41a5350b4e58e090f881b1a2807b44a4a5bd11 fix-stdio-usage.patch diff --git a/core/lvm2/patches/fix-stdio-usage.patch b/core/lvm2/patches/fix-stdio-usage.patch new file mode 100644 index 00000000..ea11b713 --- /dev/null +++ b/core/lvm2/patches/fix-stdio-usage.patch @@ -0,0 +1,49 @@ +--- ./tools/lvmcmdline.c ++++ ./tools/lvmcmdline.c +@@ -1252,7 +1252,7 @@ + int err = is_valid_fd(STDERR_FILENO); + + if (!is_valid_fd(STDIN_FILENO) && +- !(stdin = fopen(_PATH_DEVNULL, "r"))) { ++ !freopen(_PATH_DEVNULL, "r", stdin)) { + if (err) + perror("stdin stream open"); + else +@@ -1262,7 +1262,7 @@ + } + + if (!is_valid_fd(STDOUT_FILENO) && +- !(stdout = fopen(_PATH_DEVNULL, "w"))) { ++ !freopen(_PATH_DEVNULL, "w", stdout)) { + if (err) + perror("stdout stream open"); + /* else no stdout */ +@@ -1270,7 +1270,7 @@ + } + + if (!is_valid_fd(STDERR_FILENO) && +- !(stderr = fopen(_PATH_DEVNULL, "w"))) { ++ !freopen(_PATH_DEVNULL, "w", stderr)) { + printf("stderr stream open: %s\n", + strerror(errno)); + return 0; +--- ./lib/commands/toolcontext.c.orig ++++ ./lib/commands/toolcontext.c +@@ -1860,7 +1860,7 @@ + /* FIXME Make this configurable? */ + reset_lvm_errno(1); + +-#ifndef VALGRIND_POOL ++#if !defined(VALGRIND_POOL) && defined(__GLIBC__) + /* Set in/out stream buffering before glibc */ + if (set_buffering + #ifdef SYS_gettid +@@ -2254,7 +2254,7 @@ + if (cmd->libmem) + dm_pool_destroy(cmd->libmem); + +-#ifndef VALGRIND_POOL ++#if !defined(VALGRIND_POOL) && defined(__GLIBC__) + if (cmd->linebuffer) { + /* Reset stream buffering to defaults */ + if (is_valid_fd(STDIN_FILENO) && diff --git a/core/lvm2/sources b/core/lvm2/sources index 20485461..441dab2c 100644 --- a/core/lvm2/sources +++ b/core/lvm2/sources @@ -1,2 +1,3 @@ https://mirrors.kernel.org/sourceware/lvm2/releases/LVM2.2.02.184.tgz patches/portability.patch +patches/fix-stdio-usage.patch