summaryrefslogtreecommitdiffstats
path: root/src/tntfs.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/tntfs.c
parent9970a484b6983cbf5659ebf17335b4192065025e (diff)
Use pread() and pwrite() argument style for internal I/O
Diffstat (limited to 'src/tntfs.c')
-rw-r--r--src/tntfs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tntfs.c b/src/tntfs.c
index 34ecafa..8d7c552 100644
--- a/src/tntfs.c
+++ b/src/tntfs.c
@@ -116,7 +116,7 @@ int ntfs_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose
log_info("\nntfs_boot_sector\n");
log_partition(disk_car,partition);
screen_buffer_add("Boot sector\n");
- if(disk_car->read(disk_car,NTFS_BOOT_SECTOR_SIZE, buffer_bs, partition->part_offset)!=0)
+ if(disk_car->pread(disk_car, buffer_bs, NTFS_BOOT_SECTOR_SIZE, partition->part_offset) != NTFS_BOOT_SECTOR_SIZE)
{
screen_buffer_add("ntfs_boot_sector: Can't read boot sector.\n");
memset(buffer_bs,0,NTFS_BOOT_SECTOR_SIZE);
@@ -131,7 +131,7 @@ int ntfs_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose
screen_buffer_add("Status: Bad\n");
}
screen_buffer_add("\nBackup boot sector\n");
- if(disk_car->read(disk_car,NTFS_BOOT_SECTOR_SIZE, buffer_backup_bs, partition->part_offset+partition->part_size-disk_car->sector_size)!=0)
+ if(disk_car->pread(disk_car, buffer_backup_bs, NTFS_BOOT_SECTOR_SIZE, partition->part_offset + partition->part_size - disk_car->sector_size) != NTFS_BOOT_SECTOR_SIZE)
{
screen_buffer_add("ntfs_boot_sector: Can't read backup boot sector.\n");
memset(buffer_backup_bs,0,NTFS_BOOT_SECTOR_SIZE);
@@ -245,7 +245,7 @@ int ntfs_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose
if(ask_confirmation("Copy original NTFS 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,NTFS_BOOT_SECTOR_SIZE, buffer_bs, partition->part_offset+partition->part_size-disk_car->sector_size)!=0)
+ if(disk_car->pwrite(disk_car, buffer_bs, NTFS_BOOT_SECTOR_SIZE, partition->part_offset + partition->part_size - disk_car->sector_size) != NTFS_BOOT_SECTOR_SIZE)
{
display_message("Write error: Can't overwrite NTFS backup boot sector\n");
}
@@ -259,7 +259,7 @@ int ntfs_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose
if(ask_confirmation("Copy backup NTFS 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,NTFS_BOOT_SECTOR_SIZE, buffer_backup_bs, partition->part_offset)!=0)
+ if(disk_car->pwrite(disk_car, buffer_backup_bs, NTFS_BOOT_SECTOR_SIZE, partition->part_offset) != NTFS_BOOT_SECTOR_SIZE)
{
display_message("Write error: Can't overwrite NTFS boot sector\n");
}