diff options
Diffstat (limited to 'balkan')
-rw-r--r-- | balkan/balkan.h | 2 | ||||
-rw-r--r-- | balkan/dos.c | 9 | ||||
-rw-r--r-- | balkan/sun.c | 6 |
3 files changed, 10 insertions, 7 deletions
diff --git a/balkan/balkan.h b/balkan/balkan.h index 4113432f3..bc687cd2c 100644 --- a/balkan/balkan.h +++ b/balkan/balkan.h @@ -1,6 +1,6 @@ #ifndef H_BALKAN #define H_BALKAN 1 - +#define _LARGEFILE_SOURCE 1 #define _LARGEFILE64_SOURCE 1 #define BALKAN_ERROR_ERRNO 1 diff --git a/balkan/dos.c b/balkan/dos.c index e3297d25b..b60fee7ba 100644 --- a/balkan/dos.c +++ b/balkan/dos.c @@ -1,9 +1,10 @@ /* DOS style partitioning */ +#include "balkan.h" #include <fcntl.h> #include <unistd.h> +#include <sys/types.h> -#include "balkan.h" #include "byteswap.h" struct singlePartition { @@ -34,11 +35,11 @@ struct singlePartitionTable { #define LINUX_TYPE_EXTENDED 0x85 static int readSingleTable(int fd, struct singlePartitionTable * table, - long long partSector) { + off64_t partSector) { unsigned char sector[SECTOR_SIZE]; unsigned short magic; - if (lseek64(fd, ((long long) SECTOR_SIZE * (long long) partSector), + if (lseek64(fd, ((off64_t) SECTOR_SIZE * (off64_t) partSector), SEEK_SET) < 0) return BALKAN_ERROR_ERRNO; @@ -55,7 +56,7 @@ static int readSingleTable(int fd, struct singlePartitionTable * table, } static int readNextTable(int fd, struct partitionTable * table, int nextNum, - long long partSector, long long sectorOffset) { + off64_t partSector, off64_t sectorOffset) { struct singlePartitionTable singleTable; int rc; int i, thisPart; diff --git a/balkan/sun.c b/balkan/sun.c index d3c11703b..29e8578f8 100644 --- a/balkan/sun.c +++ b/balkan/sun.c @@ -1,9 +1,11 @@ /* Sun style partitioning */ +#include "balkan.h" + #include <fcntl.h> #include <unistd.h> +#include <sys/types.h> -#include "balkan.h" #include "byteswap.h" struct singlePartitionTable { @@ -98,7 +100,7 @@ int sunpReadTable(int fd, struct partitionTable * table) { default: if (table->parts[i].type != WHOLE_DISK && lseek64(fd, (8192 + 0x55c + SECTOR_SIZE * - (unsigned long long)table->parts[i].startSector), + (off64_t) table->parts[i].startSector), SEEK_SET) >= 0 && read(fd, &magic, 4) == 4 && (magic == UFS_SUPER_MAGIC || |