Changeset 8192e4ff in rtems


Ignore:
Timestamp:
Aug 7, 2008, 2:23:11 AM (11 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, master
Children:
94fb30d4
Parents:
2462541
Message:

2008-08-07 Chris Johns <chrisj@…>

  • libcsupport/src/_rename_r.c: Fixed return code bug. Add a check to see if the 'to' path was a directory and removed the directory.
  • libmisc/Makefile.am, libmisc/shell/shellconfig.h: Added the mv command.
  • libmisc/shell/main_mv.c, libmisc/shell/pathnames-mv.h: New.
Location:
cpukit
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r2462541 r8192e4ff  
     12008-08-07      Chris Johns <chrisj@rtems.org>
     2
     3        * libcsupport/src/_rename_r.c: Fixed return code bug. Add a check
     4        to see if the 'to' path was a directory and removed the directory.
     5
     6        * libmisc/Makefile.am, libmisc/shell/shellconfig.h: Added the mv command.
     7
     8        * libmisc/shell/main_mv.c, libmisc/shell/pathnames-mv.h: New.
     9
    1102008-08-06      Chris Johns <chrisj@rtems.org>
    211
  • cpukit/libcsupport/src/_rename_r.c

    r2462541 r8192e4ff  
    2626#include <rtems/seterr.h>
    2727
     28#include <sys/stat.h>
     29
    2830int _rename_r(
    2931  struct _reent *ptr,
     
    3234)
    3335{
     36  struct stat sb;
    3437  int s;
    3538
     39  s = stat( old, &sb);
     40  if ( s < 0 )
     41    return s;
    3642  s = link( old, new );
    37   if ( !s )
     43  if ( s < 0 )
    3844    return s;
    39   return unlink( old );
     45  return S_ISDIR(sb.st_mode) ? rmdir( old ) : unlink( old );
    4046}
  • cpukit/libmisc/Makefile.am

    r2462541 r8192e4ff  
    7474    shell/main_mkdir.c shell/main_mount.c \
    7575    shell/main_mount_msdos.c shell/main_mmove.c shell/main_msdosfmt.c \
    76     shell/main_mwdump.c shell/main_perioduse.c shell/main_pwd.c \
     76    shell/main_mv.c shell/main_mwdump.c shell/main_perioduse.c shell/main_pwd.c \
    7777    shell/main_rm.c shell/main_rmdir.c shell/main_sleep.c \
    7878    shell/main_stackuse.c shell/main_tty.c shell/main_umask.c \
  • cpukit/libmisc/shell/shellconfig.h

    r2462541 r8192e4ff  
    4848extern rtems_shell_cmd_t rtems_shell_CAT_Command;
    4949extern rtems_shell_cmd_t rtems_shell_MSDOSFMT_Command;
     50extern rtems_shell_cmd_t rtems_shell_MV_Command;
    5051extern rtems_shell_cmd_t rtems_shell_RM_Command;
    5152extern rtems_shell_cmd_t rtems_shell_UMASK_Command;
     
    271272    #endif
    272273    #if (defined(CONFIGURE_SHELL_COMMANDS_ALL) && \
     274         !defined(CONFIGURE_SHELL_NO_COMMAND_MV)) || \
     275        defined(CONFIGURE_SHELL_COMMAND_MV)
     276      &rtems_shell_MV_Command,
     277    #endif
     278    #if (defined(CONFIGURE_SHELL_COMMANDS_ALL) && \
    273279         !defined(CONFIGURE_SHELL_NO_COMMAND_RM)) || \
    274280        defined(CONFIGURE_SHELL_COMMAND_RM)
Note: See TracChangeset for help on using the changeset viewer.