From 8f9f2b9cdfbd1c7988542d81db1db854d48f2b0d Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sun, 2 Feb 2020 04:20:58 -0800 Subject: devlink: fix warning from unchecked write MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Warning seen on Ubuntu devlink.c: In function ‘cmd_dev_flash’: devlink.c:3071:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] 3071 | write(pipe_w, &err, sizeof(err)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 9b13cddfe268 ("devlink: implement flash status monitoring") Signed-off-by: Stephen Hemminger --- devlink/devlink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'devlink/devlink.c') diff --git a/devlink/devlink.c b/devlink/devlink.c index 73ce9865..f9e58c1d 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -3066,11 +3066,13 @@ static int cmd_dev_flash(struct dl *dl) /* In child, just execute the flash and pass returned * value through pipe once it is done. */ + int cc; + close(pipe_r); err = _mnlg_socket_send(dl->nlg, nlh); - write(pipe_w, &err, sizeof(err)); + cc = write(pipe_w, &err, sizeof(err)); close(pipe_w); - exit(0); + exit(cc != sizeof(err)); } close(pipe_w); -- cgit v1.2.3