diff --git a/src/add-ons/kernel/file_systems/dos/dosfs.c b/src/add-ons/kernel/file_systems/dos/dosfs.c index b49d9c6b0a..d7793d5995 100644 --- a/src/add-ons/kernel/file_systems/dos/dosfs.c +++ b/src/add-ons/kernel/file_systems/dos/dosfs.c @@ -572,39 +572,39 @@ dosfs_identify_partition(int fd, partition_data *partition, void **_cookie) // read in the boot sector if (read_pos(fd, 0, (void*)buf, 512) != 512) { - return 0.0f; + return -1; } // only check boot signature on hard disks to account for broken mtools // behavior if (((buf[0x1fe] != 0x55) || (buf[0x1ff] != 0xaa)) && (buf[0x15] == 0xf8)) - return 0.0f; + return -1; if (!memcmp(buf+3, "NTFS ", 8) || !memcmp(buf+3, "HPFS ", 8)) { - return 0.0f; + return -1; } // first fill in the universal fields from the bpb bytes_per_sector = read16(buf,0xb); if ((bytes_per_sector != 0x200) && (bytes_per_sector != 0x400) && (bytes_per_sector != 0x800)) { - return 0.0f; + return -1; } sectors_per_cluster = i = buf[0xd]; if ((i != 1) && (i != 2) && (i != 4) && (i != 8) && (i != 0x10) && (i != 0x20) && (i != 0x40) && (i != 0x80)) { - return 0.0f; + return -1; } reserved_sectors = read16(buf,0xe); fat_count = buf[0x10]; if ((fat_count == 0) || (fat_count > 8)) { - return 0.0f; + return -1; } // check media descriptor versus known types if ((buf[0x15] != 0xF0) && (buf[0x15] < 0xf8)) { - return 0.0f; + return -1; } strcpy(name, "no name "); @@ -626,7 +626,7 @@ dosfs_identify_partition(int fd, partition_data *partition, void **_cookie) cookie = (identify_cookie *)malloc(sizeof(identify_cookie)); if (!cookie) - return 0.0f; + return -1; cookie->bytes_per_sector = bytes_per_sector; cookie->total_sectors = total_sectors;