diff --git a/arch/sparc32/linux_load.c b/arch/sparc32/linux_load.c index 038cb50..26f7fc6 100644 --- a/arch/sparc32/linux_load.c +++ b/arch/sparc32/linux_load.c @@ -461,7 +461,7 @@ static int load_initrd(struct linux_header *hdr, uint32_t kern_end, uint64_t forced; fd = open_io(initrd_file); - if (!fd) { + if (fd == -1) { printf("Can't open initrd: %s\n", initrd_file); return -1; } @@ -609,8 +609,9 @@ int linux_load(struct sys_info *info, const char *file, const char *cmdline) char *initrd_file = NULL; fd = open_io(file); - if (!fd) + if (fd == -1) { return -1; + } kern_addr = load_linux_header(&hdr); if (kern_addr == 0) { diff --git a/arch/sparc64/linux_load.c b/arch/sparc64/linux_load.c index fe61a35..e3afc2d 100644 --- a/arch/sparc64/linux_load.c +++ b/arch/sparc64/linux_load.c @@ -461,7 +461,7 @@ static int load_initrd(struct linux_header *hdr, uint32_t kern_end, uint64_t forced; fd = open_io(initrd_file); - if (!fd) { + if (fd == -1) { printf("Can't open initrd: %s\n", initrd_file); return -1; } @@ -609,7 +609,7 @@ int linux_load(struct sys_info *info, const char *file, const char *cmdline) char *initrd_file = NULL; fd = open_io(file); - if (!fd) + if (fd == -1) return -1; kern_addr = load_linux_header(&hdr); diff --git a/arch/x86/linux_load.c b/arch/x86/linux_load.c index 9a22dce..e06326b 100644 --- a/arch/x86/linux_load.c +++ b/arch/x86/linux_load.c @@ -462,7 +462,7 @@ static int load_initrd(struct linux_header *hdr, struct sys_info *info, uint64_t forced; fd = open_io(initrd_file); - if (!fd) { + if (fd == -1) { printf("Can't open initrd: %s\n", initrd_file); return -1; } @@ -634,8 +634,9 @@ int linux_load(struct sys_info *info, const char *file, const char *cmdline) char *initrd_file = NULL; fd = open_io(file); - if (!fd) + if (fd == -1) { return -1; + } kern_addr = load_linux_header(&hdr); if (kern_addr == 0)