Commit 2e7e4206 authored by Timo Teräs's avatar Timo Teräs

main/lvm2: upgrade to 2.02.103, and fix musl build

parent 21edb0b2
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lvm2
pkgver=2.02.102
pkgver=2.02.103
pkgrel=0
pkgdesc="Logical Volume Manager 2 utilities"
url="http://sourceware.org/lvm2/"
......@@ -9,6 +9,7 @@ license="GPL"
depends=
makedepends="pkgconfig"
source="ftp://sources.redhat.com/pub/$pkgname/LVM2.$pkgver.tgz
fix-stdio-usage.patch
lvm.initd
lvm.confd
"
......@@ -19,6 +20,11 @@ _builddir="$srcdir/LVM2.$pkgver"
prepare() {
cd "$_builddir"
update_config_sub || return 1
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
}
build () {
......@@ -68,12 +74,15 @@ libs() {
mv "$pkgdir"/lib/liblvm2*.so.* "$subpkgdir"/lib/
}
md5sums="cfce545d87abf42ae4c9e0aae704619e LVM2.2.02.102.tgz
md5sums="e427e3494aaf86da2d363f344deb3837 LVM2.2.02.103.tgz
2395ae17f924ebf25e9737d02f758f8f fix-stdio-usage.patch
260dba1a691ea2ae86a3c49b39f1dd7d lvm.initd
ec36d5fe4561220304e406c5c797e71f lvm.confd"
sha256sums="7392705663f814e4cc547fb22dc6e29b7c8929fd98ca998c6dd1a9e4b92df6a1 LVM2.2.02.102.tgz
sha256sums="71c5a2e8842ed2f13f52e02b44eb183110a3410dedd1e117348e4eecc29d3c2a LVM2.2.02.103.tgz
79c5379cbf660f8dabd45359463c77a40b5a83153b54c67ce36049260dac9071 fix-stdio-usage.patch
0be9b5503c4713fb848ad050ac4e57138770d72d639f536d32cc1a77b1ecc221 lvm.initd
e2ff57977ace6098e1a2efc8a1f6796e8bf6e5dd148e4c105bb647ffc6f79230 lvm.confd"
sha512sums="a2b81d231412fea13d4b83109b55f75ccb56bef4806fbefeae057d2ab8a1012387148ee14d7ae4143ea16149b1679c92e1a13f9e9b28cf5eef50448629163195 LVM2.2.02.102.tgz
sha512sums="1a9920947312e3e248bff7ff5d5eb54dec3f3b05eb3388fa92f95369b26ae8e6838186f87d817b09e8c635ddc3cdf51bc1d07c2a9d65fd7eab33598998bb7afe LVM2.2.02.103.tgz
c4d55b366a60926baadf431dd382012eb808490c0bb514e01503d526cfd7ae573efa2d60a92bd5f6f451b54b11fb5cf827f45cec35cfcdee6aa291674cc776dd fix-stdio-usage.patch
97bd0524b3982e54cc41cec7d9cc2433d30f49175eeca95661f25906e414885d512ba21de3bbbca4a9c5496ba69b0aac9d977168d6e76f95d70ae37f3a3f65c7 lvm.initd
07caf8fa942290f3c953cc2463aaf55bac01d0bcb9351daf3880fa4d0eefb67fe00761c46a7a4da91cd2f8e492a12fed35853a15dc939cd80d19d3303bc3951d lvm.confd"
--- LVM2.2.02.103.orig/lib/commands/toolcontext.c
+++ LVM2.2.02.103/lib/commands/toolcontext.c
@@ -1336,7 +1336,10 @@
/*
* Close and reopen stream on file descriptor fd.
*/
-static int _reopen_stream(FILE *stream, int fd, const char *mode, const char *name, FILE **new_stream)
+#ifdef __GLIBC__
+#define _reopen_stream(stream, fd, mode, name) __reopen_stream(stream, fd, mode, name, &stream)
+
+static int __reopen_stream(FILE *stream, int fd, const char *mode, const char *name, FILE **new_stream)
{
int fd_copy, new_fd;
@@ -1363,6 +1366,9 @@
return 1;
}
+#else
+#define _reopen_stream(stream, fd, mode, name) (freopen(NULL, mode, stream) != NULL)
+#endif
/* Entry point */
struct cmd_context *create_toolcontext(unsigned is_long_lived,
@@ -1371,7 +1377,6 @@
unsigned threaded)
{
struct cmd_context *cmd;
- FILE *new_stream;
int flags;
#ifdef M_MMAP_MAX
@@ -1421,9 +1426,8 @@
if (is_valid_fd(STDIN_FILENO) &&
((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
(flags & O_ACCMODE) != O_WRONLY) {
- if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream))
+ if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin"))
goto_out;
- stdin = new_stream;
if (setvbuf(stdin, cmd->linebuffer, _IOLBF, linebuffer_size)) {
log_sys_error("setvbuf", "");
goto out;
@@ -1433,9 +1437,8 @@
if (is_valid_fd(STDOUT_FILENO) &&
((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
(flags & O_ACCMODE) != O_RDONLY) {
- if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream))
+ if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout"))
goto_out;
- stdout = new_stream;
if (setvbuf(stdout, cmd->linebuffer + linebuffer_size,
_IOLBF, linebuffer_size)) {
log_sys_error("setvbuf", "");
@@ -1715,7 +1718,6 @@
void destroy_toolcontext(struct cmd_context *cmd)
{
struct dm_config_tree *cft_cmdline;
- FILE *new_stream;
int flags;
if (cmd->dump_filter && cmd->filter && cmd->filter->dump &&
@@ -1752,8 +1754,7 @@
if (is_valid_fd(STDIN_FILENO) &&
((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
(flags & O_ACCMODE) != O_WRONLY) {
- if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream)) {
- stdin = new_stream;
+ if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin")) {
setlinebuf(stdin);
} else
cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */
@@ -1762,8 +1763,7 @@
if (is_valid_fd(STDOUT_FILENO) &&
((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
(flags & O_ACCMODE) != O_RDONLY) {
- if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream)) {
- stdout = new_stream;
+ if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout")) {
setlinebuf(stdout);
} else
cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */
--- LVM2.2.02.103.orig/tools/lvmcmdline.c
+++ LVM2.2.02.103/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;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment