summaryrefslogtreecommitdiff
path: root/rbutil/ipodpatcher/fat32format.c
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/ipodpatcher/fat32format.c')
-rw-r--r--rbutil/ipodpatcher/fat32format.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/rbutil/ipodpatcher/fat32format.c b/rbutil/ipodpatcher/fat32format.c
index a9417b22a2..573d3bf88a 100644
--- a/rbutil/ipodpatcher/fat32format.c
+++ b/rbutil/ipodpatcher/fat32format.c
@@ -82,7 +82,7 @@ uint32_t htole32(uint32_t x)
82 82
83 83
84/* A large aligned buffer for disk I/O */ 84/* A large aligned buffer for disk I/O */
85extern unsigned char* sectorbuf; 85extern unsigned char* ipod_sectorbuf;
86 86
87/* TODO: Pass these as parameters to the various create_ functions */ 87/* TODO: Pass these as parameters to the various create_ functions */
88 88
@@ -160,7 +160,7 @@ static int zero_sectors(struct ipod_t* ipod, uint64_t sector, int count)
160 return -1; 160 return -1;
161 } 161 }
162 162
163 memset(sectorbuf, 0, 128 * ipod->sector_size); 163 memset(ipod_sectorbuf, 0, 128 * ipod->sector_size);
164 164
165 /* Write 128 sectors at a time */ 165 /* Write 128 sectors at a time */
166 while (count) { 166 while (count) {
@@ -169,7 +169,7 @@ static int zero_sectors(struct ipod_t* ipod, uint64_t sector, int count)
169 else 169 else
170 n = count; 170 n = count;
171 171
172 if (ipod_write(ipod,sectorbuf,n * ipod->sector_size) < 0) { 172 if (ipod_write(ipod,ipod_sectorbuf,n * ipod->sector_size) < 0) {
173 perror("[ERR] Write failed in zero_sectors\n"); 173 perror("[ERR] Write failed in zero_sectors\n");
174 return -1; 174 return -1;
175 } 175 }
@@ -478,15 +478,15 @@ int format_partition(struct ipod_t* ipod, int partition)
478 fprintf(stderr,"[INFO] Initialising reserved sectors and FATs...\n" ); 478 fprintf(stderr,"[INFO] Initialising reserved sectors and FATs...\n" );
479 479
480 /* Create the boot sector structure */ 480 /* Create the boot sector structure */
481 create_boot_sector(sectorbuf, ipod, partition); 481 create_boot_sector(ipod_sectorbuf, ipod, partition);
482 create_fsinfo(sectorbuf + 512); 482 create_fsinfo(ipod_sectorbuf + 512);
483 483
484 /* Write boot sector and fsinfo at start of partition */ 484 /* Write boot sector and fsinfo at start of partition */
485 if (ipod_seek(ipod, ipod->pinfo[partition].start * ipod->sector_size) < 0) { 485 if (ipod_seek(ipod, ipod->pinfo[partition].start * ipod->sector_size) < 0) {
486 fprintf(stderr,"[ERR] Seek failed\n"); 486 fprintf(stderr,"[ERR] Seek failed\n");
487 return -1; 487 return -1;
488 } 488 }
489 if (ipod_write(ipod,sectorbuf,512 * 2) < 0) { 489 if (ipod_write(ipod,ipod_sectorbuf,512 * 2) < 0) {
490 perror("[ERR] Write failed (first copy of bootsect/fsinfo)\n"); 490 perror("[ERR] Write failed (first copy of bootsect/fsinfo)\n");
491 return -1; 491 return -1;
492 } 492 }
@@ -496,13 +496,13 @@ int format_partition(struct ipod_t* ipod, int partition)
496 fprintf(stderr,"[ERR] Seek failed\n"); 496 fprintf(stderr,"[ERR] Seek failed\n");
497 return -1; 497 return -1;
498 } 498 }
499 if (ipod_write(ipod,sectorbuf,512 * 2) < 0) { 499 if (ipod_write(ipod,ipod_sectorbuf,512 * 2) < 0) {
500 perror("[ERR] Write failed (first copy of bootsect/fsinfo)\n"); 500 perror("[ERR] Write failed (first copy of bootsect/fsinfo)\n");
501 return -1; 501 return -1;
502 } 502 }
503 503
504 /* Create the first FAT sector */ 504 /* Create the first FAT sector */
505 create_firstfatsector(sectorbuf); 505 create_firstfatsector(ipod_sectorbuf);
506 506
507 /* Write the first fat sector in the right places */ 507 /* Write the first fat sector in the right places */
508 for ( i=0; i<NumFATs; i++ ) { 508 for ( i=0; i<NumFATs; i++ ) {
@@ -513,7 +513,7 @@ int format_partition(struct ipod_t* ipod, int partition)
513 return -1; 513 return -1;
514 } 514 }
515 515
516 if (ipod_write(ipod,sectorbuf,512) < 0) { 516 if (ipod_write(ipod,ipod_sectorbuf,512) < 0) {
517 perror("[ERR] Write failed (first copy of bootsect/fsinfo)\n"); 517 perror("[ERR] Write failed (first copy of bootsect/fsinfo)\n");
518 return -1; 518 return -1;
519 } 519 }