[PATCH BlueZ] mesh: Fix ignored return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes the following build error when compiling in maintainer mode:

mesh/keyring.c: In function ‘finalize’:
mesh/keyring.c:142:8: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
  (void)write(fd, &key, sizeof(key));
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
 mesh/keyring.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mesh/keyring.c b/mesh/keyring.c
index 3a7f92f9f..806ea153c 100644
--- a/mesh/keyring.c
+++ b/mesh/keyring.c
@@ -139,7 +139,8 @@ static void finalize(const char *fpath, uint16_t net_idx)
 	l_debug("Finalize %s", fpath);
 	memcpy(key.old_key, key.new_key, 16);
 	lseek(fd, 0, SEEK_SET);
-	write(fd, &key, sizeof(key));
+	if (write(fd, &key, sizeof(key)) != sizeof(key))
+		goto done;
 
 done:
 	close(fd);
-- 
2.19.1




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux