Skip to content

Commit

Permalink
lvm2: 2.03.23 -> 2.03.24
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs124 committed Aug 23, 2024
1 parent 5b36ae9 commit 0a4fb98
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 61 deletions.
4 changes: 2 additions & 2 deletions pkgs/os-specific/linux/lvm2/2_03.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ./common.nix {
version = "2.03.23";
hash = "sha256-dOeUqene4bz4ogZfZbkZbET98yHiLWO5jtfejJqhel0=";
version = "2.03.24";
hash = "sha256-WTxVA7oA+qscbgtKWXuWBex7WIGEXAS/QS6/nRu/oTw=";
}
3 changes: 0 additions & 3 deletions pkgs/os-specific/linux/lvm2/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ stdenv.mkDerivation rec {
multipath_tools = optionalTool enableMultipath multipath-tools;
vdo = optionalTool enableVDO vdo;
}))
# Musl fix from Alpine
./fix-stdio-usage.patch
# https://gitlab.com/lvmteam/lvm2/-/merge_requests/8
./fix-static.patch
];

doCheck = false; # requires root
Expand Down
28 changes: 0 additions & 28 deletions pkgs/os-specific/linux/lvm2/fix-static.patch

This file was deleted.

58 changes: 30 additions & 28 deletions pkgs/os-specific/linux/lvm2/fix-stdio-usage.patch
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
From 63b1c7332bee6080bffecf9ce9d75ff15d799166 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 16 Nov 2022 10:42:39 +0100
Subject: [PATCH] fix stdio usage

---
lib/commands/toolcontext.c | 4 ++--
tools/lvmcmdline.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index b630554a9..f20080d18 100644
index 56dc1f856..011ec2700 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -1667,7 +1667,7 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd,
@@ -1660,6 +1660,7 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd,
/* FIXME Make this configurable? */
reset_lvm_errno(1);

-#ifndef VALGRIND_POOL
+#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
+#ifdef __GLIBC__
/* Set in/out stream buffering before glibc */
if (set_buffering
#ifdef SYS_gettid
@@ -2045,7 +2045,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
&& !cmd->running_on_valgrind /* Skipping within valgrind execution. */
@@ -1704,7 +1705,7 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd,
} else if (!set_buffering)
/* Without buffering, must not use stdin/stdout */
init_silent(1);
-
+#endif
/*
* Environment variable LVM_SYSTEM_DIR overrides this below.
*/
@@ -2038,6 +2039,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
if (cmd->cft_def_hash)
dm_hash_destroy(cmd->cft_def_hash);

dm_device_list_destroy(&cmd->cache_dm_devs);
-#ifndef VALGRIND_POOL
+#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
if (cmd->linebuffer) {
+#ifdef __GLIBC__
if (!cmd->running_on_valgrind && cmd->linebuffer) {
int flags;
/* Reset stream buffering to defaults */
if (is_valid_fd(STDIN_FILENO) &&
@@ -2061,6 +2063,7 @@ void destroy_toolcontext(struct cmd_context *cmd)

free(cmd->linebuffer);
}
+#endif

destroy_config_context(cmd);

diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index a5bb6a5c5..0ebfa375c 100644
index 1b2f7f47c..e0674d42d 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -3422,7 +3422,7 @@ static int _check_standard_fds(void)
@@ -3378,7 +3378,7 @@ static int _check_standard_fds(void)
int err = is_valid_fd(STDERR_FILENO);

if (!is_valid_fd(STDIN_FILENO) &&
Expand All @@ -43,7 +48,7 @@ index a5bb6a5c5..0ebfa375c 100644
if (err)
perror("stdin stream open");
else
@@ -3432,7 +3432,7 @@ static int _check_standard_fds(void)
@@ -3388,7 +3388,7 @@ static int _check_standard_fds(void)
}

if (!is_valid_fd(STDOUT_FILENO) &&
Expand All @@ -52,7 +57,7 @@ index a5bb6a5c5..0ebfa375c 100644
if (err)
perror("stdout stream open");
/* else no stdout */
@@ -3440,7 +3440,7 @@ static int _check_standard_fds(void)
@@ -3396,7 +3396,7 @@ static int _check_standard_fds(void)
}

if (!is_valid_fd(STDERR_FILENO) &&
Expand All @@ -61,6 +66,3 @@ index a5bb6a5c5..0ebfa375c 100644
printf("stderr stream open: %s\n",
strerror(errno));
return 0;
--
2.38.1

0 comments on commit 0a4fb98

Please sign in to comment.