On Tue, Jan 26, 2021 at 12:36:47AM +0100, Klemens Nanni wrote:
> - Add --alias/-A option to set .zip name for stdin input
> - Add --comment/-C option to add comment in .gz or .zip
> - Fix a bug that misidentified a multi-entry .zip
> - Fix a bug that did not emit double syncs for -i -p 1
> - Fix a bug in yarn that could try to access freed data
> - Do not delete multi-entry .zip files when extracting
> - Do not reject .zip entries with bit 11 set
> - Avoid a possible threads lock-order inversion
> - Ignore trailing junk after a gzip stream by default
>
> Besides the routine update, I had to amend CFLAGS to fix the following
> warning:
>
> cc -O2 -pipe -Wall -Wextra -c pigz.c
> pigz.c:4543:9: warning: implicit declaration of function 'pledge' is invalid in C99 [-Wimplicit-function-declaration]
> if (pledge("stdio rpath wpath cpath fattr chown", NULL) == -1) {
> ^
>
> That's because of this change in 2.5:
>
> --- pig.c Mon Jan 25 23:26:18 2021
> +++ pig.c Mon Jan 25 23:42:30 2021
> @@ -321,8 +330,10 @@
> buffers to about the same number.
> */
>
> -// Use large file functions if available.
> -#define _FILE_OFFSET_BITS 64
> +// Portability defines.
> +#define _FILE_OFFSET_BITS 64 // Use large file functions
> +#define _LARGE_FILES // Same thing for AIX
> +#define _POSIX_C_SOURCE 200809L // For MinGW
>
> // Included headers and what is expected from each.
> #include <stdio.h> // fflush(), fprintf(), fputs(), getchar(), putc(),
>
>
> _POSIX_C_SOURCE makes <sys/cdefs.h> define __POSIX_VISIBLE and, because
> _BSD_SOURCE is not defined, therefore also define __BSD_VISIBLE 0.
>
> <unistd.h> only protoypes pledge(2) under __BSD_VISIBLE, so fix the
> warning by defining _BSD_SOURCE such that <sys/cdefs.h> defines
> __BSD_VISIBLE 1.
daniel@ suggested putting `+#define _POSIX_C_SOURCE 200809L' under
`ifndef __OpenBSD__' which does seem a bit more straight forward.
> @@ -22,6 +21,10 @@ MASTER_SITES = https://zlib.net/pigz/
>
> MAKE_FLAGS = CC="${CC}" \
> CFLAGS="${CFLAGS} -Wall -Wextra"
> +
> +# pigz.c 2.5 defines _POSIX_C_SOURCE which prevents <unistd.h> from
> +# prototyping pledge(2), override the define
> +CFLAGS += -D_BSD_SOURCE
>
> ALL_TARGET = pigz
We could also add the following below the include and try to upstream
the overall patch for pledge(2) support:
#ifdef __OpenBSD__
# define _BSD_SOURCE /* prototype pledge(2) */
No comments:
Post a Comment