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

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