diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-10-22 15:06:08 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-10-22 15:06:08 +0000 |
commit | 46ddacf533b2b154373f0ac98c85b4ac172ccfa6 (patch) | |
tree | db40164976c9993e1b12a60bb63320a0aa382390 /firmware/test/fat/ata-sim.c | |
parent | a901c3a433125a939bef9caf6a8219f97f395fc7 (diff) |
Fat32 write updates: Nixed some bugs. Basic file creation now works. Todo: Long filenames and extensive test cases.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2742 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/test/fat/ata-sim.c')
-rw-r--r-- | firmware/test/fat/ata-sim.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/test/fat/ata-sim.c b/firmware/test/fat/ata-sim.c index a37fabcfc0..a64e0a4d4d 100644 --- a/firmware/test/fat/ata-sim.c +++ b/firmware/test/fat/ata-sim.c @@ -9,7 +9,7 @@ static FILE* file; int ata_read_sectors(unsigned long start, unsigned char count, void* buf) { - DEBUGF("Reading block 0x%lx\n",start); + DEBUGF("[Reading block 0x%lx]\n",start); if(fseek(file,start*BLOCK_SIZE,SEEK_SET)) { perror("fseek"); return -1; @@ -17,14 +17,14 @@ int ata_read_sectors(unsigned long start, unsigned char count, void* buf) if(!fread(buf,BLOCK_SIZE,count,file)) { printf("Failed reading %d blocks starting at block 0x%lx\n",count,start); perror("fread"); - return -1; + return -2; } return 0; } int ata_write_sectors(unsigned long start, unsigned char count, void* buf) { - DEBUGF("Writing block 0x%lx\n",start); + DEBUGF("[Writing block 0x%lx]\n",start); if (start == 0) { DEBUGF("Holy crap! You're writing on sector 0!\n"); @@ -37,7 +37,7 @@ int ata_write_sectors(unsigned long start, unsigned char count, void* buf) } if(!fwrite(buf,BLOCK_SIZE,count,file)) { perror("fwrite"); - return -1; + return -2; } return 0; } |