Changeset 744 for soft


Ignore:
Timestamp:
Dec 13, 2015, 1:37:34 PM (8 years ago)
Author:
alain
Message:

Fix a bug in the _fat_read() function:
The count argument should not depend on the size for a directory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_fat32/fat32.c

    r730 r744  
    32653265    }
    32663266
    3267     // check and ajust count argument
    3268     if ( count > (inode->size - seek) ) count = inode->size - seek;
     3267    // check and ajust count argument for a file
     3268    if ( (count > (inode->size - seek)) && !inode->is_dir ) count = inode->size - seek;
    32693269
    32703270    // compute first_cluster_id and first_byte_to_move
     
    44404440    }
    44414441
     4442
     4443#if GIET_DEBUG_FAT
     4444unsigned int procid  = _get_procid();
     4445unsigned int x       = procid >> (Y_WIDTH + P_WIDTH);
     4446unsigned int y       = (procid >> P_WIDTH) & ((1<<Y_WIDTH)-1);
     4447unsigned int p       = procid & ((1<<P_WIDTH)-1);
     4448if ( _get_proctime() > GIET_DEBUG_FAT )
     4449_printf("\n[DEBUG FAT] _fat_readdir(): P[%d,%d,%d] enter for <%s>\n",
     4450        x , y , p , _fat.fd[fd_id].inode->name );
     4451#endif
     4452
    44424453    while ( 1 )
    44434454    {
Note: See TracChangeset for help on using the changeset viewer.