libstoragemgmt/0001-Fix-gcc-warning-on-non-x86-platform.patch
Martin Pluskal d10e0013c8 - Sync patches with fedora:
* 0002-C-library-Bug-fix-for-incorrect-use-of-sizeof.patch
  * 0003-Simc-plugin-Fix-gcc-warning-on-fallthrough-switch.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/libstoragemgmt?expand=0&rev=35
2017-05-16 10:40:06 +00:00

43 lines
1.1 KiB
Diff

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(-)
Index: tools/udev/scan-scsi-target.c
===================================================================
--- tools/udev/scan-scsi-target.c.orig
+++ tools/udev/scan-scsi-target.c
@@ -54,7 +54,7 @@ static void __attribute__ ((__noreturn__
int main(int argc, char **argv)
{
- char c;
+ int c;
char *devpath;
char *sysfs_path;