You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
1.2 KiB

From 23f3bb1ab8311601db03757a6d4538e747364454 Mon Sep 17 00:00:00 2001
From: FUJITA Tomonori <fujita.tomonori@gmail.com>
Date: Fri, 3 May 2019 19:30:07 +0900
Subject: [PATCH 2/2] iscsi_tcp: fix compile warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
iscsi/iscsi_tcp.c: In function ‘iscsi_tcp_alloc_data_buf’:
iscsi/iscsi_tcp.c:583:2: error: ignoring return value of ‘posix_memalign’, declared with attribute warn_unused_result [-Werror=unused-result]
posix_memalign(&addr, sysconf(_SC_PAGESIZE), sz);
^
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
---
usr/iscsi/iscsi_tcp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/usr/iscsi/iscsi_tcp.c b/usr/iscsi/iscsi_tcp.c
index 5762c23..0a076b0 100644
--- a/usr/iscsi/iscsi_tcp.c
+++ b/usr/iscsi/iscsi_tcp.c
@@ -579,8 +579,8 @@ static void iscsi_tcp_free_task(struct iscsi_task *task)
static void *iscsi_tcp_alloc_data_buf(struct iscsi_connection *conn, size_t sz)
{
void *addr = NULL;
-
- posix_memalign(&addr, sysconf(_SC_PAGESIZE), sz);
+ if (posix_memalign(&addr, sysconf(_SC_PAGESIZE), sz) != 0)
+ return addr;
return addr;
}
--
2.21.0