devlink: fix warning from unchecked write

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: 9b13cddfe2 ("devlink: implement flash status monitoring")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Stephen Hemminger 2020-02-02 04:20:58 -08:00
parent 5cdeb77cd6
commit 8f9f2b9cdf
1 changed files with 4 additions and 2 deletions

View File

@ -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);