From c8331371301f30c1a5c893c991023cfaad8bab11 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 20 Jun 2014 04:02:00 +0000 Subject: [PATCH] iscsi-scst: Suppress a compiler warning Avoid that the following compiler warning is reported when compiling iscsi-scst: chap.c: In function 'chap_rand': chap.c:348:5: warning: ignoring return value of 'read', declared with attribute warn_unused_result [-Wunused-result] (void)read(fd, &r, sizeof(r)); ^ Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5614 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/usr/chap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iscsi-scst/usr/chap.c b/iscsi-scst/usr/chap.c index 287210a1f..a54309be4 100644 --- a/iscsi-scst/usr/chap.c +++ b/iscsi-scst/usr/chap.c @@ -344,7 +344,8 @@ static int chap_rand(void) fd = open("/dev/urandom", O_RDONLY); assert(fd != -1); - (void)read(fd, &r, sizeof(r)); + if (read(fd, &r, sizeof(r)) < sizeof(r)) { + } close(fd); return r; }