diff --git a/fs/fat/fs_fat32.c b/fs/fat/fs_fat32.c index 22db4a97869..fc10b867a1a 100644 --- a/fs/fat/fs_fat32.c +++ b/fs/fat/fs_fat32.c @@ -1288,7 +1288,7 @@ static off_t fat_seek(FAR struct file *filep, off_t offset, int whence) if (position / fs->fs_hwsectorsize == filep->f_pos / fs->fs_hwsectorsize) { filep->f_pos = position; - return OK; + return position; } /* Make sure that the mount is still healthy */ @@ -1316,7 +1316,7 @@ static off_t fat_seek(FAR struct file *filep, off_t offset, int whence) filep->f_pos = position; nxmutex_unlock(&fs->fs_lock); - return OK; + return position; errout_with_lock: nxmutex_unlock(&fs->fs_lock); diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c index fbe9ba87fcf..c97092016d3 100644 --- a/fs/romfs/fs_romfs.c +++ b/fs/romfs/fs_romfs.c @@ -579,7 +579,7 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence) errout_with_lock: nxrmutex_unlock(&rm->rm_lock); - return ret; + return ret < 0 ? ret : position; } /****************************************************************************