Changeset 3dbe4ca2 in mainline for uspace/srv/fs/fat/fat_ops.c


Ignore:
Timestamp:
2011-04-29T11:10:24Z (13 years ago)
Author:
Oleg Romanenko <romanenko.oleg@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ce8f4f4
Parents:
d260a95 (diff), 933cadf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_ops.c

    rd260a95 r3dbe4ca2  
    5555#include <sys/mman.h>
    5656#include <align.h>
     57#include <malloc.h>
    5758
    5859#define FAT_NODE(node)  ((node) ? (fat_node_t *) (node)->data : NULL)
     
    724725                    (str_cmp((char *) d->name, FAT_NAME_DOT)) == 0) {
    725726                        memset(d, 0, sizeof(fat_dentry_t));
    726                         str_cpy((char *) d->name, 8, FAT_NAME_DOT);
    727                         str_cpy((char *) d->ext, 3, FAT_EXT_PAD);
     727                        memcpy(d->name, FAT_NAME_DOT, FAT_NAME_LEN);
     728                        memcpy(d->ext, FAT_EXT_PAD, FAT_EXT_LEN);
    728729                        d->attr = FAT_ATTR_SUBDIR;
    729730                        d->firstc = host2uint16_t_le(childp->firstc);
     
    734735                    (str_cmp((char *) d->name, FAT_NAME_DOT_DOT) == 0)) {
    735736                        memset(d, 0, sizeof(fat_dentry_t));
    736                         str_cpy((char *) d->name, 8, FAT_NAME_DOT_DOT);
    737                         str_cpy((char *) d->ext, 3, FAT_EXT_PAD);
     737                        memcpy(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN);
     738                        memcpy(d->ext, FAT_EXT_PAD, FAT_EXT_LEN);
    738739                        d->attr = FAT_ATTR_SUBDIR;
    739740                        d->firstc = (parentp->firstc == FAT_CLST_ROOT) ?
     
    10021003        }
    10031004
    1004         /* Determining type of FAT  */
    1005         if (FAT_IS_FAT12(bs)) {
    1006                 printf("Found FAT12 filesystem\n");
    1007         } else if (FAT_IS_FAT16(bs)) {
    1008                 printf("Found FAT16 filesystem\n");
    1009         } else {
    1010                 printf("FAT32 filesystem is not supported by FAT server.\n");
     1005        /* Return NOT SUPPORTED if try to mount FAT32  */
     1006        if (!FAT_IS_FAT12(bs) && !FAT_IS_FAT16(bs)) {
    10111007                block_fini(devmap_handle);
    10121008                async_answer_0(rid, ENOTSUP);
     
    10171013        rc = fat_sanity_check(bs, devmap_handle);
    10181014        if (rc != EOK) {
    1019                 printf("Sanity check failed\n");
    10201015                (void) block_cache_fini(devmap_handle);
    10211016                block_fini(devmap_handle);
Note: See TracChangeset for help on using the changeset viewer.