summaryrefslogtreecommitdiffstats
path: root/src/fat32.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-01-31 17:07:08 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2009-01-31 17:07:08 +0100
commit56d98fd7a229c8839a364a8a194c89c8fa650fff (patch)
treefabc87d58b2ea35831496d5f9762f6b64b481072 /src/fat32.c
parent9970a484b6983cbf5659ebf17335b4192065025e (diff)
Use pread() and pwrite() argument style for internal I/O
Diffstat (limited to 'src/fat32.c')
-rw-r--r--src/fat32.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fat32.c b/src/fat32.c
index b83da0f..0f23b10 100644
--- a/src/fat32.c
+++ b/src/fat32.c
@@ -119,7 +119,7 @@ int fat32_boot_sector(disk_t *disk_car, partition_t *partition, const int verbos
log_info("\nfat32_boot_sector\n");
log_partition(disk_car,partition);
screen_buffer_add("Boot sector\n");
- if(disk_car->read(disk_car,3*disk_car->sector_size, buffer_bs, partition->part_offset)!=0)
+ if(disk_car->pread(disk_car, buffer_bs, 3 * disk_car->sector_size, partition->part_offset) != 3 * disk_car->sector_size)
{
screen_buffer_add("fat32_boot_sector: Can't read boot sector.\n");
memset(buffer_bs,0,3*disk_car->sector_size);
@@ -142,7 +142,7 @@ int fat32_boot_sector(disk_t *disk_car, partition_t *partition, const int verbos
screen_buffer_add("Bad\n");
}
screen_buffer_add("\nBackup boot sector\n");
- if(disk_car->read(disk_car,3*disk_car->sector_size, buffer_backup_bs, partition->part_offset+6*disk_car->sector_size)!=0)
+ if(disk_car->pread(disk_car, buffer_backup_bs, 3 * disk_car->sector_size, partition->part_offset + 6 * disk_car->sector_size) != 3 * disk_car->sector_size)
{
screen_buffer_add("fat32_boot_sector: Can't read backup boot sector.\n");
memset(buffer_backup_bs,0,3*disk_car->sector_size);
@@ -268,7 +268,7 @@ int fat32_boot_sector(disk_t *disk_car, partition_t *partition, const int verbos
if(ask_confirmation("Copy original FAT32 boot sector over backup boot, confirm ? (Y/N)")!=0)
{
log_info("copy original boot sector over backup boot\n");
- if(disk_car->write(disk_car,3*disk_car->sector_size, buffer_bs, partition->part_offset+6*disk_car->sector_size)!=0)
+ if(disk_car->pwrite(disk_car, buffer_bs, 3 * disk_car->sector_size, partition->part_offset + 6 * disk_car->sector_size) != 3 * disk_car->sector_size)
{
display_message("Write error: Can't overwrite FAT32 backup boot sector\n");
}
@@ -282,7 +282,7 @@ int fat32_boot_sector(disk_t *disk_car, partition_t *partition, const int verbos
if(ask_confirmation("Copy backup FAT32 boot sector over boot sector, confirm ? (Y/N)")!=0)
{
log_info("copy backup boot sector over boot sector\n");
- if(disk_car->write(disk_car,3*disk_car->sector_size, buffer_backup_bs, partition->part_offset)!=0)
+ if(disk_car->pwrite(disk_car, buffer_backup_bs, 3 * disk_car->sector_size, partition->part_offset) != 3 * disk_car->sector_size)
{
display_message("Write error: Can't overwrite FAT32 boot sector\n");
}