From patchwork Tue Jan 19 23:56:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [10/17] usb-linux.c: fix warning with _FORTIFY_SOURCE Date: Tue, 19 Jan 2010 13:56:17 -0000 From: Juan Quintela X-Patchwork-Id: 43250 Message-Id: <36ef64634c0f27d079bef67f7d2cbc592640edc8.1263944807.git.quintela@redhat.com> To: qemu-devel@nongnu.org Cc: kirill@shutemov.name From: Kirill A. Shutemov 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 Signed-off-by: Juan Quintela --- usb-linux.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/usb-linux.c b/usb-linux.c index 88728e9..be1d979 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -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)