Bug fix for 086eeb17 in efivar 26.

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2016-08-16 17:15:11 -04:00
parent 4986eb434b
commit 83152fab66
3 changed files with 5 additions and 51 deletions

View File

@ -1,48 +0,0 @@
From 181edb851ee929ee4628fc8c053eb0c89d869bd0 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 11 Aug 2016 15:46:06 -0400
Subject: [PATCH] util.h: add int_add for 32-bit platforms
---
src/util.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/util.h b/src/util.h
index 80f5fab..a519ac2 100644
--- a/src/util.h
+++ b/src/util.h
@@ -38,12 +38,23 @@
*/
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
#if __GNUC__ >= 5 && __GNUC_MINOR__ >= 1
+#define int_add(a, b, c) __builtin_add_overflow(a, b, c)
#define long_add(a, b, c) __builtin_add_overflow(a, b, c)
#define long_mult(a, b, c) __builtin_mul_overflow(a, b, c)
#define ulong_add(a, b, c) __builtin_add_overflow(a, b, c)
#define ulong_mult(a, b, c) __builtin_mul_overflow(a, b, c)
#endif
#endif
+#ifndef int_add
+#define int_add(a, b, c) ({ \
+ const int _limit = INT_MAX; \
+ int _ret; \
+ _ret = _limit - (a) > (b); \
+ if (!_ret) \
+ *(c) = ((a) + (b)); \
+ _ret; \
+ })
+#endif
#ifndef long_add
#define long_add(a, b, c) ({ \
const long _limit = LONG_MAX; \
@@ -92,6 +103,7 @@
#endif
#define add(a, b, c) _Generic((c), \
+ int *: int_add(a,b,c), \
long *: long_add(a,b,c), \
unsigned long *: ulong_add(a,b,c))
--
2.7.4

View File

@ -1,5 +1,5 @@
Name: efivar Name: efivar
Version: 26 Version: 27
Release: 1%{?dist} Release: 1%{?dist}
Summary: Tools to manage UEFI variables Summary: Tools to manage UEFI variables
License: LGPLv2.1 License: LGPLv2.1
@ -9,7 +9,6 @@ ExclusiveArch: %{ix86} x86_64 aarch64
BuildRequires: popt-devel popt-static git glibc-static BuildRequires: popt-devel popt-static git glibc-static
Source0: https://github.com/rhinstaller/efivar/releases/download/efivar-%{version}/efivar-%{version}.tar.bz2 Source0: https://github.com/rhinstaller/efivar/releases/download/efivar-%{version}/efivar-%{version}.tar.bz2
Patch0001: 0001-util.h-add-int_add-for-32-bit-platforms.patch
%description %description
efivar provides a simple command line interface to the UEFI variable facility. efivar provides a simple command line interface to the UEFI variable facility.
@ -70,6 +69,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/*.so.* %{_libdir}/*.so.*
%changelog %changelog
* Tue Aug 16 2016 Peter Jones <pjones@redhat.com> - 27-0.1
- Bug fix for 086eeb17 in efivar 26.
* Wed Aug 10 2016 Peter Jones <pjones@redhat.com> - 26-1 * Wed Aug 10 2016 Peter Jones <pjones@redhat.com> - 26-1
- Update to efivar-26 . - Update to efivar-26 .

View File

@ -1 +1 @@
84aaf1924413f0d394e02f63bbafb3db efivar-26.tar.bz2 1d783ceacaeaa84b8f1617894e05263d efivar-27.tar.bz2