From 6fd31accd3a961640a0674738bc0aff23e50113a Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 15 Apr 2008 17:28:22 +0000 Subject: [PATCH] makebootable was broken under Haiku: * Haiku partitions are block devices. * Unlike BeOS Haiku requires a size parameter to be passed to ioctl() for B_GET_PARTITION_INFO. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24972 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/makebootable/platform/bios_ia32/makebootable.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bin/makebootable/platform/bios_ia32/makebootable.cpp b/src/bin/makebootable/platform/bios_ia32/makebootable.cpp index 44c3fb9148..beaab72710 100644 --- a/src/bin/makebootable/platform/bios_ia32/makebootable.cpp +++ b/src/bin/makebootable/platform/bios_ia32/makebootable.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007, Ingo Weinhold, bonefish@users.sf.net. + * Copyright 2005-2008, Ingo Weinhold, bonefish@users.sf.net. * Distributed under the terms of the MIT License. */ @@ -456,9 +456,12 @@ main(int argc, const char *const *argv) #else // !HAIKU_HOST_PLATFORM_LINUX + // partitions are block devices under Haiku, but not under BeOS + #ifndef __HAIKU__ fprintf(stderr, "Error: Block devices not supported on this " "platform!\n"); exit(1); + #endif // __HAIKU__ #endif } else { @@ -482,7 +485,8 @@ main(int argc, const char *const *argv) && strlen(fileName) >= 3 && strncmp("raw", fileName + strlen(fileName) - 3, 3)) { partition_info partitionInfo; - if (ioctl(fd, B_GET_PARTITION_INFO, &partitionInfo) == 0) { + if (ioctl(fd, B_GET_PARTITION_INFO, &partitionInfo, + sizeof(partitionInfo)) == 0) { partitionOffset = partitionInfo.offset; } else { fprintf(stderr, "Error: Failed to get partition info: %s\n",