mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
haiku/getroot.c (grub_util_find_partition_start_os): Avoid division by zero.
This commit is contained in:
1 parent
4e0a25a4c0
commit
ac8bac2496
2 files changed
+6
-1
No files matched your search
@@ -1,3 +1,8 @@
|
|||||||
|
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/osdep/haiku/getroot.c (grub_util_find_partition_start_os):
|
||||||
|
Avoid division by zero.
|
||||||
|
|
||||||
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
|
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/kern/generic/rtc_get_time_ms.c (grub_rtc_get_time_ms): Avoid
|
* grub-core/kern/generic/rtc_get_time_ms.c (grub_rtc_get_time_ms): Avoid
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ grub_util_find_partition_start_os (const char *dev)
|
|||||||
device_geometry geo;
|
device_geometry geo;
|
||||||
if (ioctl (fd, B_GET_GEOMETRY, &geo, sizeof (geo)) < 0)
|
if (ioctl (fd, B_GET_GEOMETRY, &geo, sizeof (geo)) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
ret /= geo.bytes_per_sector;
|
ret /= geo.bytes_per_sector ? : 512;
|
||||||
close (fd);
|
close (fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user