diff options
Diffstat (limited to 'cpukit/libfs/src/dosfs')
-rw-r--r-- | cpukit/libfs/src/dosfs/fat.c | 18 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/fat_fat_operations.c | 20 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/fat_file.c | 20 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos.h | 6 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_conv.c | 2 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_conv_default.c | 8 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_conv_utf8.c | 8 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_create.c | 4 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_dir.c | 20 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_file.c | 17 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_format.c | 13 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_init.c | 17 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_initsupp.c | 2 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_misc.c | 25 | ||||
-rw-r--r-- | cpukit/libfs/src/dosfs/msdos_mknod.c | 2 |
15 files changed, 85 insertions, 97 deletions
diff --git a/cpukit/libfs/src/dosfs/fat.c b/cpukit/libfs/src/dosfs/fat.c index 32fdeb0042..88b4a2859b 100644 --- a/cpukit/libfs/src/dosfs/fat.c +++ b/cpukit/libfs/src/dosfs/fat.c @@ -93,7 +93,6 @@ fat_buf_release(fat_fs_info_t *fs_info) uint32_t sec_num = fs_info->c.blk_num; bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && (sec_num < fs_info->vol.rdir_loc)); - uint32_t blk = fat_sector_num_to_block_num(fs_info, sec_num); uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); @@ -115,6 +114,7 @@ fat_buf_release(fat_fs_info_t *fs_info) for (i = 1; i < fs_info->vol.fats; i++) { rtems_bdbuf_buffer *bd; + uint32_t blk; sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i, blk = fat_sector_num_to_block_num(fs_info, sec_num); @@ -164,7 +164,7 @@ fat_buf_release(fat_fs_info_t *fs_info) * buff - buffer provided by user * * RETURNS: - * bytes read on success, or -1 if error occured + * bytes read on success, or -1 if error occurred * and errno set appropriately */ ssize_t @@ -259,7 +259,7 @@ fat_block_write( * buff - buffer provided by user * * RETURNS: - * bytes written on success, or -1 if error occured + * bytes written on success, or -1 if error occurred * and errno set appropriately */ ssize_t @@ -388,7 +388,7 @@ fat_cluster_set( * fs_info - FS info * * RETURNS: - * 0 on success, or -1 if error occured and errno set appropriately + * 0 on success, or -1 if error occurred and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) @@ -410,7 +410,7 @@ _fat_block_release(fat_fs_info_t *fs_info) * buff - buffer provided by user * * RETURNS: - * bytes written on success, or -1 if error occured + * bytes written on success, or -1 if error occurred * and errno set appropriately */ ssize_t @@ -472,7 +472,7 @@ static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) * fs_info - FS info * * RETURNS: - * RC_OK on success, or -1 if error occured + * RC_OK on success, or -1 if error occurred * and errno set appropriately */ int @@ -785,7 +785,7 @@ fat_init_volume_info(fat_fs_info_t *fs_info, const char *device) * fs_info - FS info * * RETURNS: - * RC_OK on success, or -1 if error occured (errno set appropriately) + * RC_OK on success, or -1 if error occurred (errno set appropriately) */ static int fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info) @@ -854,7 +854,7 @@ fat_sync(fat_fs_info_t *fs_info) * fs_info - FS info * * RETURNS: - * RC_OK on success, or -1 if error occured + * RC_OK on success, or -1 if error occurred * and errno set appropriately */ int @@ -905,7 +905,7 @@ fat_shutdown_drive(fat_fs_info_t *fs_info) * start_cluster_num - num of first cluster in the chain * * RETURNS: - * RC_OK on success, or -1 if error occured + * RC_OK on success, or -1 if error occurred * and errno set appropriately */ int diff --git a/cpukit/libfs/src/dosfs/fat_fat_operations.c b/cpukit/libfs/src/dosfs/fat_fat_operations.c index ab03c88fdc..fe6bbf03ce 100644 --- a/cpukit/libfs/src/dosfs/fat_fat_operations.c +++ b/cpukit/libfs/src/dosfs/fat_fat_operations.c @@ -37,7 +37,7 @@ * count - count of clusters to allocate (chain length) * * RETURNS: - * RC_OK on success, or error code if error occured (errno set + * RC_OK on success, or error code if error occurred (errno set * appropriately) * * @@ -170,7 +170,7 @@ cleanup: * chain - number of the first cluster in the chain * * RETURNS: - * RC_OK on success, or -1 if error occured (errno set appropriately) + * RC_OK on success, or -1 if error occurred (errno set appropriately) */ int fat_free_fat_clusters_chain( @@ -203,9 +203,9 @@ fat_free_fat_clusters_chain( cur_cln = next_cln; } - fs_info->vol.next_cl = chain; - if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) - fs_info->vol.free_cls += freed_cls_cnt; + fs_info->vol.next_cl = chain; + if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) + fs_info->vol.free_cls += freed_cls_cnt; fat_buf_release(fs_info); if (rc1 != RC_OK) @@ -225,7 +225,7 @@ fat_free_fat_clusters_chain( * the chain) * * RETURNS: - * RC_OK on success, or -1 if error occured + * RC_OK on success, or -1 if error occurred * and errno set appropriately */ int @@ -308,7 +308,7 @@ fat_get_fat_cluster( * in_val - value to set * * RETURNS: - * RC_OK on success, or -1 if error occured + * RC_OK on success, or -1 if error occurred * and errno set appropriately */ int @@ -356,7 +356,7 @@ fat_set_fat_cluster( if (rc != RC_OK) return rc; - *sec_buf &= 0x00; + *sec_buf = 0x00; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); @@ -364,7 +364,7 @@ fat_set_fat_cluster( } else { - *(sec_buf + ofs + 1) &= 0x00; + *(sec_buf + ofs + 1) = 0x00; *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); } @@ -372,7 +372,7 @@ fat_set_fat_cluster( else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; - *(sec_buf + ofs) &= 0x00; + *(sec_buf + ofs) = 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); diff --git a/cpukit/libfs/src/dosfs/fat_file.c b/cpukit/libfs/src/dosfs/fat_file.c index ef9df0a67c..3384818801 100644 --- a/cpukit/libfs/src/dosfs/fat_file.c +++ b/cpukit/libfs/src/dosfs/fat_file.c @@ -82,7 +82,7 @@ fat_file_lseek( * * RETURNS: * RC_OK and pointer to opened descriptor on success, or -1 if error - * occured (errno set appropriately) + * occurred (errno set appropriately) */ int fat_file_open( @@ -208,7 +208,7 @@ fat_file_update(fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd) * fat_fd - fat-file descriptor * * RETURNS: - * RC_OK, or -1 if error occured (errno set appropriately) + * RC_OK, or -1 if error occurred (errno set appropriately) */ int fat_file_close( @@ -280,7 +280,7 @@ fat_file_close( * buf - buffer provided by user * * RETURNS: - * the number of bytes read on success, or -1 if error occured (errno + * the number of bytes read on success, or -1 if error occurred (errno * set appropriately) */ ssize_t @@ -414,7 +414,7 @@ static bool * * RETURNS: * number of bytes actually written to the file on success, or -1 if - * error occured (errno set appropriately) + * error occurred (errno set appropriately) */ static ssize_t fat_file_write_fat32_or_non_root_dir( @@ -490,7 +490,7 @@ fat_file_write_fat32_or_non_root_dir( * * RETURNS: * number of bytes actually written to the file on success, or -1 if - * error occured (errno set appropriately) + * error occurred (errno set appropriately) */ ssize_t fat_file_write( @@ -578,7 +578,7 @@ fat_file_write( * a_length - placeholder for result - actual new length of file * * RETURNS: - * RC_OK and new length of file on success, or -1 if error occured (errno + * RC_OK and new length of file on success, or -1 if error occurred (errno * set appropriately) */ int @@ -648,7 +648,7 @@ fat_file_extend( rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, &cls_added, &last_cl, zero_fill); - /* this means that low level I/O error occured */ + /* this means that low level I/O error occurred */ if (rc != RC_OK) return rc; @@ -730,7 +730,7 @@ fat_file_extend( * new_length - new length * * RETURNS: - * RC_OK on success, or -1 if error occured (errno set appropriately) + * RC_OK on success, or -1 if error occurred (errno set appropriately) */ int fat_file_truncate( @@ -795,7 +795,7 @@ fat_file_truncate( * ... * * RETURNS: - * RC_OK on success, or -1 if error occured and errno set appropriately + * RC_OK on success, or -1 if error occurred and errno set appropriately */ int fat_file_ioctl( @@ -894,7 +894,7 @@ fat_file_mark_removed( * fat_fd - fat-file descriptor * * RETURNS: - * RC_OK on success, or -1 if error occured (errno set appropriately) + * RC_OK on success, or -1 if error occurred (errno set appropriately) */ int fat_file_size( diff --git a/cpukit/libfs/src/dosfs/msdos.h b/cpukit/libfs/src/dosfs/msdos.h index df9600a02d..e6d650c8d5 100644 --- a/cpukit/libfs/src/dosfs/msdos.h +++ b/cpukit/libfs/src/dosfs/msdos.h @@ -11,7 +11,7 @@ * Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru> * * Modifications to support UTF-8 in the file system are - * Copyright (c) 2013 embedded brains GmbH. + * Copyright (c) 2013 embedded brains GmbH & Co. KG * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -72,12 +72,12 @@ typedef struct msdos_fs_info_s rtems_dosfs_convert_control *converter; } msdos_fs_info_t; -RTEMS_INLINE_ROUTINE void msdos_fs_lock(msdos_fs_info_t *fs_info) +static inline void msdos_fs_lock(msdos_fs_info_t *fs_info) { rtems_recursive_mutex_lock(&fs_info->vol_mutex); } -RTEMS_INLINE_ROUTINE void msdos_fs_unlock(msdos_fs_info_t *fs_info) +static inline void msdos_fs_unlock(msdos_fs_info_t *fs_info) { rtems_recursive_mutex_unlock(&fs_info->vol_mutex); } diff --git a/cpukit/libfs/src/dosfs/msdos_conv.c b/cpukit/libfs/src/dosfs/msdos_conv.c index 7efd5a7e80..ba28a07512 100644 --- a/cpukit/libfs/src/dosfs/msdos_conv.c +++ b/cpukit/libfs/src/dosfs/msdos_conv.c @@ -25,7 +25,7 @@ * October 1992 * * Modifications to support UTF-8 in the file system are - * Copyright (c) 2013 embedded brains GmbH. + * Copyright (c) 2013 embedded brains GmbH & Co. KG */ #ifdef HAVE_CONFIG_H diff --git a/cpukit/libfs/src/dosfs/msdos_conv_default.c b/cpukit/libfs/src/dosfs/msdos_conv_default.c index a3f6b835ee..43cff88c6c 100644 --- a/cpukit/libfs/src/dosfs/msdos_conv_default.c +++ b/cpukit/libfs/src/dosfs/msdos_conv_default.c @@ -7,13 +7,7 @@ */ /* - * Copyright (c) 2013 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * Copyright (c) 2013 embedded brains GmbH & Co. KG * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at diff --git a/cpukit/libfs/src/dosfs/msdos_conv_utf8.c b/cpukit/libfs/src/dosfs/msdos_conv_utf8.c index cc5c0271a7..36027eb2f3 100644 --- a/cpukit/libfs/src/dosfs/msdos_conv_utf8.c +++ b/cpukit/libfs/src/dosfs/msdos_conv_utf8.c @@ -7,13 +7,7 @@ */ /* - * Copyright (c) 2013 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * Copyright (c) 2013 embedded brains GmbH & Co. KG * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at diff --git a/cpukit/libfs/src/dosfs/msdos_create.c b/cpukit/libfs/src/dosfs/msdos_create.c index 1304cc27cd..f71969f787 100644 --- a/cpukit/libfs/src/dosfs/msdos_create.c +++ b/cpukit/libfs/src/dosfs/msdos_create.c @@ -55,7 +55,7 @@ * (see msdos_file.c, msdos_link for documentation) * * RETURNS: - * RC_OK on success, or -1 if error occured (errno set appropriately). + * RC_OK on success, or -1 if error occurred (errno set appropriately). * */ int @@ -202,7 +202,7 @@ msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc, fs_info->fat.vol.bpc, &unused); if (rc != RC_OK) - goto err; + goto error; /* * dot and dotdot entries are identical to new node except the diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c index 8c8d43f130..d9585635d9 100644 --- a/cpukit/libfs/src/dosfs/msdos_dir.c +++ b/cpukit/libfs/src/dosfs/msdos_dir.c @@ -11,7 +11,7 @@ * Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru> * * Modifications to support UTF-8 in the file system are - * Copyright (c) 2013 embedded brains GmbH. + * Copyright (c) 2013 embedded brains GmbH & Co. KG * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -58,7 +58,7 @@ * count - count of bytes to read * * RETURNS: - * the number of bytes read on success, or -1 if error occured (errno + * the number of bytes read on success, or -1 if error occurred (errno * set apropriately). */ ssize_t @@ -339,14 +339,14 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) iop->offset = iop->offset + sizeof(struct dirent); cmpltd += (sizeof(struct dirent)); count -= (sizeof(struct dirent)); + } - /* inode number extracted, close fat-file */ - rc = fat_file_close(&fs_info->fat, tmp_fat_fd); - if (rc != RC_OK) - { - msdos_fs_unlock(fs_info); - return rc; - } + /* inode number extracted, close fat-file */ + rc = fat_file_close(&fs_info->fat, tmp_fat_fd); + if (rc != RC_OK) + { + msdos_fs_unlock(fs_info); + return rc; } } @@ -381,7 +381,7 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) * buf - stat buffer provided by user * * RETURNS: - * RC_OK and filled stat buffer on success, or -1 if error occured (errno + * RC_OK and filled stat buffer on success, or -1 if error occurred (errno * set apropriately). */ int diff --git a/cpukit/libfs/src/dosfs/msdos_file.c b/cpukit/libfs/src/dosfs/msdos_file.c index e799105658..e25f292484 100644 --- a/cpukit/libfs/src/dosfs/msdos_file.c +++ b/cpukit/libfs/src/dosfs/msdos_file.c @@ -41,7 +41,7 @@ * count - the number of bytes to read * * RETURNS: - * the number of bytes read on success, or -1 if error occured (errno set + * the number of bytes read on success, or -1 if error occurred (errno set * appropriately) */ ssize_t @@ -72,7 +72,7 @@ msdos_file_read(rtems_libio_t *iop, void *buffer, size_t count) * count - count of bytes to write * * RETURNS: - * the number of bytes written on success, or -1 if error occured + * the number of bytes written on success, or -1 if error occurred * and errno set appropriately */ ssize_t @@ -117,7 +117,7 @@ msdos_file_write(rtems_libio_t *iop,const void *buffer, size_t count) * buf - stat buffer provided by user * * RETURNS: - * RC_OK on success, or -1 if error occured (errno set appropriately) + * RC_OK on success, or -1 if error occurred (errno set appropriately) */ int msdos_file_stat( @@ -155,7 +155,7 @@ msdos_file_stat( * length - new length * * RETURNS: - * RC_OK on success, or -1 if error occured (errno set appropriately). + * RC_OK on success, or -1 if error occurred (errno set appropriately). */ int msdos_file_ftruncate(rtems_libio_t *iop, off_t length) @@ -179,7 +179,7 @@ msdos_file_ftruncate(rtems_libio_t *iop, off_t length) length, &new_length); if (rc == RC_OK && length != new_length) { - fat_file_truncate(&fs_info->fat, fat_fd, old_length); + (void) fat_file_truncate(&fs_info->fat, fat_fd, old_length); errno = ENOSPC; rc = -1; } @@ -204,7 +204,7 @@ msdos_file_ftruncate(rtems_libio_t *iop, off_t length) * iop - file control block * * RETURNS: - * RC_OK on success, or -1 if error occured (errno set appropriately) + * RC_OK on success, or -1 if error occurred (errno set appropriately) */ int msdos_file_sync(rtems_libio_t *iop) @@ -223,6 +223,11 @@ msdos_file_sync(rtems_libio_t *iop) } rc = fat_sync(&fs_info->fat); + if (rc != RC_OK) + { + msdos_fs_unlock(fs_info); + return rc; + } msdos_fs_unlock(fs_info); diff --git a/cpukit/libfs/src/dosfs/msdos_format.c b/cpukit/libfs/src/dosfs/msdos_format.c index 5786b0b1cb..7d7afe4b22 100644 --- a/cpukit/libfs/src/dosfs/msdos_format.c +++ b/cpukit/libfs/src/dosfs/msdos_format.c @@ -9,15 +9,12 @@ */ /* - * Copyright (C) 2004 IMD - * Ingenieurbuero fuer Microcomputertechnik Th. Doerfler - * <Thomas.Doerfler@imd-systems.de> + * Copyright (c) 2004 IMD Ingenieurbuero fuer Microcomputertechnik + * All rights reserved. * - * All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. */ #ifdef HAVE_CONFIG_H diff --git a/cpukit/libfs/src/dosfs/msdos_init.c b/cpukit/libfs/src/dosfs/msdos_init.c index 67b16b64ed..2ea3c025c7 100644 --- a/cpukit/libfs/src/dosfs/msdos_init.c +++ b/cpukit/libfs/src/dosfs/msdos_init.c @@ -11,10 +11,10 @@ * Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru> * * Modifications to support reference counting in the file system are - * Copyright (c) 2012 embedded brains GmbH. + * Copyright (c) 2012 embedded brains GmbH & Co. KG * * Modifications to support UTF-8 in the file system are - * Copyright (c) 2013 embedded brains GmbH. + * Copyright (c) 2013 embedded brains GmbH & Co. KG * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -36,18 +36,17 @@ static int msdos_clone_node_info(rtems_filesystem_location_info_t *loc) return fat_file_reopen(fat_fd); } -static int msdos_utime( +static int msdos_utimens( const rtems_filesystem_location_info_t *loc, - time_t actime, - time_t modtime + struct timespec times[2] ) { fat_file_fd_t *fat_fd = loc->node_access; - if (actime != modtime) + if (times[0].tv_sec != times[1].tv_sec) rtems_set_errno_and_return_minus_one( ENOTSUP ); - fat_file_set_mtime(fat_fd, modtime); + fat_file_set_mtime(fat_fd, times[1].tv_sec); return RC_OK; } @@ -67,7 +66,7 @@ const rtems_filesystem_operations_table msdos_ops = { .mount_h = rtems_filesystem_default_mount, .unmount_h = rtems_filesystem_default_unmount, .fsunmount_me_h = msdos_shut_down, - .utime_h = msdos_utime, + .utimens_h = msdos_utimens, .symlink_h = rtems_filesystem_default_symlink, .readlink_h = rtems_filesystem_default_readlink, .rename_h = msdos_rename, @@ -92,7 +91,7 @@ void msdos_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry) * temp_mt_entry - mount table entry * * RETURNS: - * RC_OK on success, or -1 if error occured (errno set apropriately). + * RC_OK on success, or -1 if error occurred (errno set apropriately). * */ int rtems_dosfs_initialize( diff --git a/cpukit/libfs/src/dosfs/msdos_initsupp.c b/cpukit/libfs/src/dosfs/msdos_initsupp.c index e2ee85d4d4..6394f2ee58 100644 --- a/cpukit/libfs/src/dosfs/msdos_initsupp.c +++ b/cpukit/libfs/src/dosfs/msdos_initsupp.c @@ -44,7 +44,7 @@ * directory_handlers - directory operations table * * RETURNS: - * RC_OK and filled temp_mt_entry on success, or -1 if error occured + * RC_OK and filled temp_mt_entry on success, or -1 if error occurred * (errno set apropriately) * */ diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c index 5da48776c8..cd59c494ea 100644 --- a/cpukit/libfs/src/dosfs/msdos_misc.c +++ b/cpukit/libfs/src/dosfs/msdos_misc.c @@ -11,7 +11,7 @@ * Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru> * * Modifications to support UTF-8 in the file system are - * Copyright (c) 2013 embedded brains GmbH. + * Copyright (c) 2013 embedded brains GmbH & Co. KG * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -288,7 +288,6 @@ msdos_long_to_short(rtems_dosfs_convert_control *converter, &codepage_name_len); if (eno == EINVAL) { - eno = 0; type = MSDOS_NAME_LONG; } else @@ -334,7 +333,7 @@ msdos_long_to_short(rtems_dosfs_convert_control *converter, * * RETURNS: * RC_OK and updated 'parent_loc' on success, or -1 if error - * occured (errno set apropriately) + * occurred (errno set apropriately) * */ int @@ -476,7 +475,7 @@ msdos_find_name( * * RETURNS: * RC_OK, filled aux_struct_ptr and name_dir_entry on success, or -1 if - * error occured (errno set apropriately) + * error occurred (errno set apropriately) * */ int @@ -570,7 +569,7 @@ msdos_get_name_node( * dir_entry - placeholder for found node * * RETURNS: - * RC_OK, filled 'paux' and 'dir_entry' on success, or -1 if error occured + * RC_OK, filled 'paux' and 'dir_entry' on success, or -1 if error occurred * (errno set apropriately) * */ @@ -702,7 +701,7 @@ msdos_get_dotdot_dir_info_cluster_num_and_offset( * fat_fd - fat-file descriptor * * RETURNS: - * RC_OK on success, or -1 if error occured (errno set apropriately). + * RC_OK on success, or -1 if error occurred (errno set apropriately). * */ int @@ -772,7 +771,7 @@ fat_file_write_time_and_date( * fat_fd - fat-file descriptor * * RETURNS: - * RC_OK on success, or -1 if error occured + * RC_OK on success, or -1 if error occurred * */ int @@ -820,7 +819,7 @@ fat_file_write_first_cluster_num( * fat_fd - fat-file descriptor * * RETURNS: - * RC_OK on success, or -1 if error occured (errno set apropriately). + * RC_OK on success, or -1 if error occurred (errno set apropriately). * */ int @@ -868,7 +867,7 @@ fat_file_write_file_size( * fchar - character to set up * * RETURNS: - * RC_OK on success, or -1 if error occured (errno set apropriately) + * RC_OK on success, or -1 if error occurred (errno set apropriately) * */ int @@ -939,7 +938,7 @@ msdos_set_first_char4file_name( * ret_val - placeholder for result * * RETURNS: - * RC_OK on success, or -1 if error occured + * RC_OK on success, or -1 if error occurred * */ int @@ -1304,7 +1303,6 @@ static int msdos_find_file_in_directory ( const uint8_t *filename_converted, const size_t name_len_for_compare, - const size_t name_len_for_save, const msdos_name_type_t name_type, msdos_fs_info_t *fs_info, fat_file_fd_t *fat_fd, @@ -1747,6 +1745,8 @@ msdos_add_file ( /* Get position of short file name entry */ ret = msdos_get_pos(fs_info, fat_fd, bts2rd, short_file_offset, &dir_pos->sname); + if (ret != RC_OK) + return ret; /* * Handle the entry writes. @@ -1918,7 +1918,6 @@ msdos_find_name_in_fat_file ( retval = msdos_find_file_in_directory ( buffer, name_len_for_compare, - name_len_for_save, name_type, fs_info, fat_fd, @@ -2001,7 +2000,7 @@ msdos_find_name_in_fat_file ( * dir_entry - placeholder for found node * * RETURNS: - * RC_OK on success, or error code if error occured + * RC_OK on success, or error code if error occurred * */ int msdos_find_node_by_cluster_num_in_fat_file( diff --git a/cpukit/libfs/src/dosfs/msdos_mknod.c b/cpukit/libfs/src/dosfs/msdos_mknod.c index 934805c5f1..8fe01e4985 100644 --- a/cpukit/libfs/src/dosfs/msdos_mknod.c +++ b/cpukit/libfs/src/dosfs/msdos_mknod.c @@ -44,7 +44,7 @@ int msdos_mknod( ) { int rc = RC_OK; - fat_file_type_t type = 0; + fat_file_type_t type = FAT_DIRECTORY; /* * Figure out what type of msdos node this is. |