[arch-commits] Commit in xz/trunk (PKGBUILD logical-op.patch)
Pierre Schmitz
pierre at archlinux.org
Sun Nov 20 09:32:19 UTC 2016
Date: Sunday, November 20, 2016 @ 09:32:19
Author: pierre
Revision: 281649
Fix FS#51775
Added:
xz/trunk/logical-op.patch
Modified:
xz/trunk/PKGBUILD
------------------+
PKGBUILD | 14 +++++++++++---
logical-op.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2016-11-20 08:52:29 UTC (rev 281648)
+++ PKGBUILD 2016-11-20 09:32:19 UTC (rev 281649)
@@ -4,7 +4,7 @@
pkgname=xz
pkgver=5.2.2
-pkgrel=1
+pkgrel=2
pkgdesc='Library and command line tools for XZ and LZMA compressed files'
arch=('i686' 'x86_64')
url='http://tukaani.org/xz/'
@@ -11,11 +11,19 @@
license=('GPL' 'LGPL' 'custom')
depends=('sh')
source=("http://tukaani.org/${pkgname}/${pkgname}-${pkgver}.tar.gz"
- "http://tukaani.org/${pkgname}/${pkgname}-${pkgver}.tar.gz.sig")
+ "http://tukaani.org/${pkgname}/${pkgname}-${pkgver}.tar.gz.sig"
+ 'logical-op.patch')
md5sums=('7cf6a8544a7dae8e8106fdf7addfa28c'
- 'SKIP')
+ 'SKIP'
+ '51942446b4d3264e8de2f9676ee94075')
validpgpkeys=('3690C240CE51B4670D30AD1C38EE757D69184620')
+prepare() {
+ cd ${srcdir}/${pkgname}-${pkgver}
+
+ patch -p1 -i ${srcdir}/logical-op.patch
+}
+
build() {
cd ${srcdir}/${pkgname}-${pkgver}
Added: logical-op.patch
===================================================================
--- logical-op.patch (rev 0)
+++ logical-op.patch 2016-11-20 09:32:19 UTC (rev 281649)
@@ -0,0 +1,50 @@
+From 1b0ac0c53c761263e91e34195cb21dfdcfeac0bd Mon Sep 17 00:00:00 2001
+From: Lasse Collin <lasse.collin at tukaani.org>
+Date: Thu, 16 Jun 2016 22:46:02 +0300
+Subject: [PATCH 1/1] xz: Silence warnings from -Wlogical-op.
+
+Thanks to Evan Nemerson.
+---
+ src/xz/file_io.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/xz/file_io.c b/src/xz/file_io.c
+index 69cf632..2ca188b 100644
+--- a/src/xz/file_io.c
++++ b/src/xz/file_io.c
+@@ -45,6 +45,14 @@ static bool warn_fchown;
+ # define O_NOCTTY 0
+ #endif
+
++// Using this macro to silence a warning from gcc -Wlogical-op.
++#if EAGAIN == EWOULDBLOCK
++# define IS_EAGAIN_OR_EWOULDBLOCK(e) ((e) == EAGAIN)
++#else
++# define IS_EAGAIN_OR_EWOULDBLOCK(e) \
++ ((e) == EAGAIN || (e) == EWOULDBLOCK)
++#endif
++
+
+ typedef enum {
+ IO_WAIT_MORE, // Reading or writing is possible.
+@@ -1102,7 +1110,7 @@ io_read(file_pair *pair, io_buf *buf_union, size_t size)
+ }
+
+ #ifndef TUKLIB_DOSLIKE
+- if (errno == EAGAIN || errno == EWOULDBLOCK) {
++ if (IS_EAGAIN_OR_EWOULDBLOCK(errno)) {
+ const io_wait_ret ret = io_wait(pair,
+ mytime_get_flush_timeout(),
+ true);
+@@ -1190,7 +1198,7 @@ io_write_buf(file_pair *pair, const uint8_t *buf, size_t size)
+ }
+
+ #ifndef TUKLIB_DOSLIKE
+- if (errno == EAGAIN || errno == EWOULDBLOCK) {
++ if (IS_EAGAIN_OR_EWOULDBLOCK(errno)) {
+ if (io_wait(pair, -1, false) == IO_WAIT_MORE)
+ continue;
+
+--
+1.8.5.5
+
More information about the arch-commits
mailing list