From 5372949efbd19abeba1de0bb3ce84d7c59155cfb Mon Sep 17 00:00:00 2001 From: andersen Date: Fri, 6 Feb 2004 05:26:58 +0000 Subject: Eliminate use of a kernel scsi header file. Prevent potentially misaligned accesses while indexing a pointer to the partition table, which would be a bad thing on i.e. arm. git-svn-id: svn://busybox.net/trunk/busybox@8415 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- util-linux/fdisk.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'util-linux') diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 891380395..2374960df 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c @@ -26,12 +26,7 @@ #include #include /* assert */ #include - #include -#define u_char unsigned char -#include /* SCSI_IOCTL_GET_IDLUN */ -#undef u_char - #include #include #include /* major */ @@ -93,6 +88,10 @@ #define cround(n) (display_in_cyl_units ? ((n)/units_per_sector)+1 : (n)) #define scround(x) (((x)+units_per_sector-1)/units_per_sector) +#ifdef CONFIG_FEATURE_SUN_LABEL +#define SCSI_IOCTL_GET_IDLUN 0x5382 +#endif + #if defined(CONFIG_LFS) || defined(FDISK_SUPPORT_LARGE_DISKS) || defined(__alpha__) || defined(__ia64__) || defined(__s390x__) typedef long long fdisk_loff_t; @@ -203,7 +202,7 @@ struct partition { unsigned char end_cyl; /* end cylinder */ unsigned char start4[4]; /* starting sector counting from 0 */ unsigned char size4[4]; /* nr of sectors in partition */ -}; +} __attribute__((__packed__)); enum failure { ioctl_error, unable_to_open, unable_to_read, unable_to_seek, -- cgit v1.2.3-55-g6feb