Ignore:
Timestamp:
Jul 31, 2017, 2:46:50 PM (7 years ago)
Author:
max@…
Message:

Style, and use hal_strcpy_from_uspace.

File:
1 edited

Legend:

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

    r23 r305  
    3535{
    3636    error_t     error;
    37     paddr_t     paddr;
    38     uint32_t    length;
    3937    char        kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
    4038       
     
    4240        process_t * process = this->process;
    4341
    44     // check pathname in user space
    45     error = vmm_v2p_translate( false , pathname , &paddr );
     42    // get pathname copy in kernel space
     43    error = hal_strcpy_from_uspace( kbuf , pathname , CONFIG_VFS_MAX_PATH_LENGTH );
    4644
    47         if( error )
    48         {
    49         printk("\n[ERROR] in %s : user buffer unmapped  for thread %x in process %x\n",
    50                __FUNCTION__ , this->trdid , process->pid );
    51                 this->errno = EINVAL;
    52                 return -1;
    53         }       
    54 
    55     // get pathname length
    56     length = hal_strlen_from_uspace( pathname );
    57 
    58     if( length >= CONFIG_VFS_MAX_PATH_LENGTH )
     45    if( error )
    5946    {
    6047        printk("\n[ERROR] in %s : pathname too long\n", __FUNCTION__ );
     
    6249        return -1;
    6350    }
    64  
    65         // get pathname copy in kernel space
    66     hal_copy_from_uspace( kbuf, pathname, length );
    6751
    6852    // get cluster and local pointer on reference process
Note: See TracChangeset for help on using the changeset viewer.