From 8e5a2f9d98307d615fc815daace91479803285c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?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=UTF-8 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)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- mesh/keyring.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesh/keyring.c b/mesh/keyring.c index 9fa7d6bd0..41cb2e980 100644 --- a/mesh/keyring.c +++ b/mesh/keyring.c @@ -140,7 +140,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.47.3