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:
parent
5cdeb77cd6
commit
8f9f2b9cdf
|
|
@ -3066,11 +3066,13 @@ static int cmd_dev_flash(struct dl *dl)
|
||||||
/* In child, just execute the flash and pass returned
|
/* In child, just execute the flash and pass returned
|
||||||
* value through pipe once it is done.
|
* value through pipe once it is done.
|
||||||
*/
|
*/
|
||||||
|
int cc;
|
||||||
|
|
||||||
close(pipe_r);
|
close(pipe_r);
|
||||||
err = _mnlg_socket_send(dl->nlg, nlh);
|
err = _mnlg_socket_send(dl->nlg, nlh);
|
||||||
write(pipe_w, &err, sizeof(err));
|
cc = write(pipe_w, &err, sizeof(err));
|
||||||
close(pipe_w);
|
close(pipe_w);
|
||||||
exit(0);
|
exit(cc != sizeof(err));
|
||||||
}
|
}
|
||||||
close(pipe_w);
|
close(pipe_w);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue