summaryrefslogtreecommitdiff
path: root/sys-fs/lvm2/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-07-09 15:43:36 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-07-09 15:43:36 +0100
commit2719f73b6813d11d13a9650cdd2ab8ec6e69385d (patch)
tree8c816148bcbd22757d892089c989ae614eae4f5a /sys-fs/lvm2/files
parent0f558761aa2dee1017b4751e4017205e015a9560 (diff)
gentoo resync : 09.07.2022
Diffstat (limited to 'sys-fs/lvm2/files')
-rw-r--r--sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch b/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch
new file mode 100644
index 000000000000..5ca32f19fc54
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.03.14-freopen_n2.patch
@@ -0,0 +1,34 @@
+In musl, the standard streams are read-only. To modify them we need to
+use freopen. This patch does the same as lvm2-2.03.14-r1-fopen-to-freopen.patch
+
+https://listman.redhat.com/archives/lvm-devel/2022-June/024203.html
+
+See also:
+https://wiki.gentoo.org/wiki/User:Sam/Musl_porting_notes#error:_assignment_of_read-only_variable_.27.5Bstdout.7Cstdin.7Cstderr.5D.27
+https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html
+
+---
+ lib/log/log.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/lib/log/log.c b/lib/log/log.c
+index 7b4d537..897c183 100644
+--- a/lib/log/log.c
++++ b/lib/log/log.c
+@@ -207,8 +207,12 @@ int reopen_standard_stream(FILE **stream, const char *mode)
+ }
+
+ _check_and_replace_standard_log_streams(old_stream, new_stream);
+-
++
++#ifdef __GLIBC__
+ *stream = new_stream;
++#else
++ freopen(NULL, mode, *stream);
++#endif
+ return 1;
+ }
+
+--
+2.35.1
+