From 6d4892d620cc663f1481632f3d74f4ed33f8dab9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Lowas-Rzechonek?= Date: Tue, 12 Nov 2019 15:54:25 +0100 Subject: [PATCH] mesh: Fix ignored return value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I0fb908ee59ae2db2dcd682c342dd94107419ab89 Signed-off-by: Anupam Roy --- mesh/keyring.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesh/keyring.c b/mesh/keyring.c index 7ce5bf3..3eccf7e 100644 --- a/mesh/keyring.c +++ b/mesh/keyring.c @@ -141,7 +141,9 @@ 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.7.4