Ignore:
Timestamp:
Nov 10, 2018, 2:33:26 PM (3 years ago)
Author:
alain
Message:

Fix various bugs in sys_stat() and sys_mmap() functions.
Improve debug in other functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_write.c

    r584 r594  
    153153                                count );
    154154    }
    155     else if( type == INODE_TYPE_DEV )  // check ownership & write to device
    156     {
    157         // check user buffer size for TXT_TX
    158         if( (type == INODE_TYPE_DEV) && (count >= CONFIG_TXT_KBUF_SIZE) )
    159         {
    160 
    161 #if DEBUG_SYSCALLS_ERROR
    162 printk("\n[ERROR] in %s : thread[%x,%x] user buffer size %x too large\n",
    163 __FUNCTION__ , process->pid, this->trdid, count );
    164 #endif
    165                     this->errno = EINVAL;
    166                     return -1;
    167         }
    168 
     155    else if( type == INODE_TYPE_DEV )  // write to TXT device
     156    {
    169157        // move count bytes to device
    170158        nbytes = devfs_user_move( false,             // from buffer to device
     
    175163    else  // not FILE and not DEV
    176164    {
    177         nbytes = 0;
    178         assert( false , "file type %d non supported\n", type );
     165
     166#if DEBUG_SYSCALLS_ERROR
     167printk("\n[ERROR] in %s : thread[%x,%x] / illegal inode type %\n",
     168__FUNCTION__, vfs_inode_type_str( type ) );
     169#endif
     170                this->errno = EBADFD;
     171                return -1;
    179172    }
    180173
     
    186179__FUNCTION__ , process->pid, this->trdid, file_id );
    187180#endif
    188         this->errno = error;
     181        this->errno = EIO;
    189182        return -1;
    190183    }
Note: See TracChangeset for help on using the changeset viewer.