Accepting request 490917 from home:alarrosa:branches:Base:System

- Add 0001-Fix-gcc-warning-on-non-x86-platform.patch to fix build in
  ppc64le/s390x.

OBS-URL: https://build.opensuse.org/request/show/490917
OBS-URL: https://build.opensuse.org/package/show/Base:System/libstoragemgmt?expand=0&rev=33
This commit is contained in:
Martin Pluskal 2017-04-25 08:30:21 +00:00 committed by Git OBS Bridge
parent 2e1a150afc
commit 7c1587d507
3 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,42 @@
From 2a2d9a8200f987b42966ab4e96b7769b8f9a159f Mon Sep 17 00:00:00 2001
From: Gris Ge <fge@redhat.com>
Date: Wed, 22 Feb 2017 16:18:20 +0800
Subject: [PATCH] udev: Fix gcc warning on non-x86 platform.
Issue:
Got failure on s390x:
scan-scsi-target.c:90:2: error: comparison is always true due to limited
range of data type [-Werror=type-limits]
Root cause:
The error is on these lines:
char c;
...
while ((c = getopt_long(argc, argv, "rh", longopts, NULL)) != -1) {
On non-x86 platform, char is unsigned. Which makes the (c != -1)
always true.
Fix:
Take return of getopt_long() as int.
Signed-off-by: Gris Ge <fge@redhat.com>
---
tools/udev/scan-scsi-target.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/udev/scan-scsi-target.c b/tools/udev/scan-scsi-target.c
index bb83c65..00126b9 100644
--- a/tools/udev/scan-scsi-target.c
+++ b/tools/udev/scan-scsi-target.c
@@ -54,7 +54,7 @@ static void __attribute__ ((__noreturn__)) invalid(char **argv, char *devpath)
int main(int argc, char **argv)
{
- char c;
+ int c;
char *devpath;
char *sysfs_path;

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Apr 25 07:27:25 UTC 2017 - alarrosa@suse.com
- Add 0001-Fix-gcc-warning-on-non-x86-platform.patch to fix build in
ppc64le/s390x.
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Apr 24 11:10:59 UTC 2017 - alarrosa@suse.com Mon Apr 24 11:10:59 UTC 2017 - alarrosa@suse.com

View File

@ -26,6 +26,8 @@ License: LGPL-2.1+
Group: System/Libraries Group: System/Libraries
Url: https://github.com/libstorage/libstoragemgmt Url: https://github.com/libstorage/libstoragemgmt
Source0: https://github.com/libstorage/libstoragemgmt/releases/download/%{version}/%{name}-%{version}.tar.gz Source0: https://github.com/libstorage/libstoragemgmt/releases/download/%{version}/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM 0001-Fix-gcc-warning-on-non-x86-platform.patch -- Fix build in ppc64le/s390x related to getopt_long
Patch0: 0001-Fix-gcc-warning-on-non-x86-platform.patch
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: libconfig-devel BuildRequires: libconfig-devel
@ -192,6 +194,7 @@ management via hpssacli.
%prep %prep
%setup -q %setup -q
%patch0 -p1
%build %build
%configure \ %configure \