usb-linux.c: fix warning with _FORTIFY_SOURCE
authorKirill A. Shutemov <kirill@shutemov.name>
Tue, 19 Jan 2010 23:56:17 +0000 (00:56 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 26 Jan 2010 20:59:20 +0000 (14:59 -0600)
CC    usb-linux.o
cc1: warnings being treated as errors
usb-linux.c: In function 'usb_host_read_file':
usb-linux.c:1204: error: ignoring return value of 'fgets', declared with attribute warn_unused_result
make: *** [usb-linux.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb-linux.c

index 5619b30..1aaa595 100644 (file)
@@ -1201,9 +1201,8 @@ static int usb_host_read_file(char *line, size_t line_size, const char *device_f
              device_file);
     f = fopen(filename, "r");
     if (f) {
-        fgets(line, line_size, f);
+        ret = fgets(line, line_size, f) != NULL;
         fclose(f);
-        ret = 1;
 #if 0
     } else {
         if (mon)