mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 19:49:43 +00:00
microvm: check g_file_set_contents() return value
Fixes: CID 1465239 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20211108130718.840216-3-kraxel@redhat.com>
This commit is contained in:
parent
1b38ccc9a1
commit
b9e5628ca5
@ -336,7 +336,10 @@ void dt_setup_microvm(MicrovmMachineState *mms)
|
||||
|
||||
if (debug) {
|
||||
fprintf(stderr, "%s: writing microvm.fdt\n", __func__);
|
||||
g_file_set_contents("microvm.fdt", mms->fdt, size, NULL);
|
||||
if (!g_file_set_contents("microvm.fdt", mms->fdt, size, NULL)) {
|
||||
fprintf(stderr, "%s: writing microvm.fdt failed\n", __func__);
|
||||
return;
|
||||
}
|
||||
int ret = system("dtc -I dtb -O dts microvm.fdt");
|
||||
if (ret != 0) {
|
||||
fprintf(stderr, "%s: oops, dtc not installed?\n", __func__);
|
||||
|
Loading…
Reference in New Issue
Block a user