Revision 5a41ecc5
b/hw/pc.c | ||
---|---|---|
613 | 613 |
|
614 | 614 |
mb_kernel_data = qemu_malloc(mb_kernel_size); |
615 | 615 |
fseek(f, mb_kernel_text_offset, SEEK_SET); |
616 |
fread(mb_kernel_data, 1, mb_kernel_size, f); |
|
616 |
if (fread(mb_kernel_data, 1, mb_kernel_size, f) != mb_kernel_size) { |
|
617 |
fprintf(stderr, "fread() failed\n"); |
|
618 |
exit(1); |
|
619 |
} |
|
617 | 620 |
fclose(f); |
618 | 621 |
} |
619 | 622 |
|
... | ... | |
887 | 890 |
setup = qemu_malloc(setup_size); |
888 | 891 |
kernel = qemu_malloc(kernel_size); |
889 | 892 |
fseek(f, 0, SEEK_SET); |
890 |
fread(setup, 1, setup_size, f); |
|
891 |
fread(kernel, 1, kernel_size, f); |
|
893 |
if (fread(setup, 1, setup_size, f) != setup_size) { |
|
894 |
fprintf(stderr, "fread() failed\n"); |
|
895 |
exit(1); |
|
896 |
} |
|
897 |
if (fread(kernel, 1, kernel_size, f) != kernel_size) { |
|
898 |
fprintf(stderr, "fread() failed\n"); |
|
899 |
exit(1); |
|
900 |
} |
|
892 | 901 |
fclose(f); |
893 | 902 |
memcpy(setup, header, MIN(sizeof(header), setup_size)); |
894 | 903 |
|
Also available in: Unified diff