You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
173 lines
6.0 KiB
173 lines
6.0 KiB
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
# |
|
# Filename: package/.../musl/pkg_patch/lvm2/lvm2-musl-read-only-assignment.patch.old |
|
# Copyright (C) 2012 The OpenSDE Project |
|
# |
|
# More information can be found in the files COPYING and README. |
|
# |
|
# This patch file is dual-licensed. It is available under the license the |
|
# patched project is licensed under, as long as it is an OpenSource license |
|
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms |
|
# of the GNU General Public License as published by the Free Software |
|
# Foundation; either version 2 of the License, or (at your option) any later |
|
# version. |
|
# --- SDE-COPYRIGHT-NOTE-END --- |
|
|
|
--- ./configure.in.orig 2012-10-15 16:24:58.000000000 +0200 |
|
+++ ./configure.in 2012-11-24 19:02:28.453087873 +0100 |
|
@@ -140,7 +140,6 @@ |
|
AC_FUNC_CHOWN |
|
AC_FUNC_FORK |
|
AC_FUNC_LSTAT |
|
-AC_FUNC_MALLOC |
|
AC_FUNC_MEMCMP |
|
AC_FUNC_MMAP |
|
AC_FUNC_REALLOC |
|
--- ./autoconf/config.sub.orig 2012-11-24 19:02:28.473087879 +0100 |
|
+++ ./autoconf/config.sub 2012-11-24 19:02:28.477087877 +0100 |
|
@@ -123,8 +123,8 @@ |
|
# Here we must recognize all the valid KERNEL-OS combinations. |
|
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` |
|
case $maybe_os in |
|
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ |
|
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ |
|
+ nto-qnx* | linux-gnu* | linux-musl* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ |
|
+ uclinux-uclibc* | uclinux-gnu* | linux-musl* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ |
|
kopensolaris*-gnu* | \ |
|
storm-chaos* | os2-emx* | rtmk-nova*) |
|
os=-$maybe_os |
|
@@ -1294,7 +1294,7 @@ |
|
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ |
|
| -chorusos* | -chorusrdb* | -cegcc* \ |
|
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ |
|
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ |
|
+ | -mingw32* | -linux-gnu* | -linux-musl* | -linux-newlib* | -linux-uclibc* \ |
|
| -uxpv* | -beos* | -mpeix* | -udk* \ |
|
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ |
|
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ |
|
--- ./daemons/dmeventd/dmeventd.c.orig 2012-11-24 19:08:48.981918074 +0100 |
|
+++ ./daemons/dmeventd/dmeventd.c 2012-11-24 19:09:25.822750433 +0100 |
|
@@ -37,6 +37,7 @@ |
|
#include <unistd.h> |
|
#include <signal.h> |
|
#include <arpa/inet.h> /* for htonl, ntohl */ |
|
+#include <fcntl.h> |
|
|
|
#ifdef linux |
|
/* |
|
--- ./libdm/mm/pool-fast.c.orig 2012-11-24 19:05:17.413015858 +0100 |
|
+++ ./libdm/mm/pool-fast.c 2012-11-24 19:05:56.589926540 +0100 |
|
@@ -18,6 +18,7 @@ |
|
#endif |
|
|
|
#include "dmlib.h" |
|
+#include <stddef.h> |
|
#include <malloc.h> |
|
|
|
struct chunk { |
|
--- ./tools/lvmcmdline.c.orig 2012-11-24 19:32:51.319288478 +0100 |
|
+++ ./tools/lvmcmdline.c 2012-11-24 19:34:46.381960596 +0100 |
|
@@ -1194,9 +1194,12 @@ |
|
static int _check_standard_fds(void) |
|
{ |
|
int err = is_valid_fd(STDERR_FILENO); |
|
+ FILE *stdin_stream = stdin; |
|
+ FILE *stdout_stream = stdout; |
|
+ FILE *stderr_stream = stderr; |
|
|
|
if (!is_valid_fd(STDIN_FILENO) && |
|
- !(stdin = fopen(_PATH_DEVNULL, "r"))) { |
|
+ !(stdin_stream = fopen(_PATH_DEVNULL, "r"))) { |
|
if (err) |
|
perror("stdin stream open"); |
|
else |
|
@@ -1206,7 +1209,7 @@ |
|
} |
|
|
|
if (!is_valid_fd(STDOUT_FILENO) && |
|
- !(stdout = fopen(_PATH_DEVNULL, "w"))) { |
|
+ !(stdout_stream = fopen(_PATH_DEVNULL, "w"))) { |
|
if (err) |
|
perror("stdout stream open"); |
|
/* else no stdout */ |
|
@@ -1214,7 +1217,7 @@ |
|
} |
|
|
|
if (!is_valid_fd(STDERR_FILENO) && |
|
- !(stderr = fopen(_PATH_DEVNULL, "w"))) { |
|
+ !(stderr_stream = fopen(_PATH_DEVNULL, "w"))) { |
|
printf("stderr stream open: %s\n", |
|
strerror(errno)); |
|
return 0; |
|
--- ./lib/commands/toolcontext.c.orig 2012-11-24 19:16:13.532208503 +0100 |
|
+++ ./lib/commands/toolcontext.c 2012-11-24 19:45:44.053159552 +0100 |
|
@@ -1315,6 +1315,8 @@ |
|
{ |
|
struct cmd_context *cmd; |
|
FILE *new_stream; |
|
+ FILE *stdin_stream = stdin; |
|
+ FILE *stdout_stream = stdout; |
|
|
|
#ifdef M_MMAP_MAX |
|
mallopt(M_MMAP_MAX, 0); |
|
@@ -1359,20 +1361,20 @@ |
|
} |
|
|
|
if (is_valid_fd(STDIN_FILENO)) { |
|
- if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream)) |
|
+ if (!_reopen_stream(stdin_stream, STDIN_FILENO, "r", "stdin", &new_stream)) |
|
goto_out; |
|
- stdin = new_stream; |
|
- if (setvbuf(stdin, cmd->linebuffer, _IOLBF, linebuffer_size)) { |
|
+ stdin_stream = new_stream; |
|
+ if (setvbuf(stdin_stream, cmd->linebuffer, _IOLBF, linebuffer_size)) { |
|
log_sys_error("setvbuf", ""); |
|
goto out; |
|
} |
|
} |
|
|
|
if (is_valid_fd(STDOUT_FILENO)) { |
|
- if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream)) |
|
+ if (!_reopen_stream(stdout_stream, STDOUT_FILENO, "w", "stdout", &new_stream)) |
|
goto_out; |
|
- stdout = new_stream; |
|
- if (setvbuf(stdout, cmd->linebuffer + linebuffer_size, |
|
+ stdout_stream = new_stream; |
|
+ if (setvbuf(stdout_stream, cmd->linebuffer + linebuffer_size, |
|
_IOLBF, linebuffer_size)) { |
|
log_sys_error("setvbuf", ""); |
|
goto out; |
|
@@ -1629,6 +1631,8 @@ |
|
{ |
|
struct dm_config_tree *cft_cmdline; |
|
FILE *new_stream; |
|
+ FILE *stdin_stream = stdin; |
|
+ FILE *stdout_stream = stdout; |
|
|
|
if (cmd->dump_filter) |
|
persistent_filter_dump(cmd->filter, 1); |
|
@@ -1655,17 +1659,17 @@ |
|
if (cmd->linebuffer) { |
|
/* Reset stream buffering to defaults */ |
|
if (is_valid_fd(STDIN_FILENO)) { |
|
- if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream)) { |
|
- stdin = new_stream; |
|
- setlinebuf(stdin); |
|
+ if (_reopen_stream(stdin_stream, STDIN_FILENO, "r", "stdin", &new_stream)) { |
|
+ stdin_stream = new_stream; |
|
+ setlinebuf(stdin_stream); |
|
} else |
|
cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */ |
|
} |
|
|
|
if (is_valid_fd(STDOUT_FILENO)) { |
|
- if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream)) { |
|
- stdout = new_stream; |
|
- setlinebuf(stdout); |
|
+ if (_reopen_stream(stdout_stream, STDOUT_FILENO, "w", "stdout", &new_stream)) { |
|
+ stdout_stream = new_stream; |
|
+ setlinebuf(stdout_stream); |
|
} else |
|
cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */ |
|
}
|
|
|