libstoragemgmt/0001-Fix-gcc-warning-on-non-x86-platform.patch

43 lines
1.1 KiB
Diff
Raw Normal View History

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;