DragonFly BSD
DragonFly commits List (threaded) for 2012-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: /bin/mv: Sync with FreeBSD


From: John Marino <marino@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Nov 2012 01:28:11 -0800 (PST)

commit 46c7fb85d65f149352ad0eeb4d067b97ff57ce9e
Author: John Marino <draco@marino.st>
Date:   Fri Nov 16 10:21:09 2012 +0100

    /bin/mv: Sync with FreeBSD
    
    1. Utilize central <paths.h> header
    2. Meet posix spec for moving directory to existing non-empty directory
    3. Meet posix spec for not moving directory over a file
    4. Don't chop IO into pieces, use MAXPHYS
    5. Add -h flag (similar to ln -h flag)
    6. Test for input_is_terminal
    7. Regression test added.
    
    DETAILS
    ==========================================================================
    1. remove pathnames.h file and add _PATH_RM to paths.h
    2. Moving a directory to an existing non-empty directory will now fail as
       required.
    3. Prior to change this test past, but after change it failed on
       cross-link devices.  Original code added to check for case and return
       -1 for the cross-link case.
    4. Read files in one block and improve warn messages.
    5. Using -h flag will force mv to treat a symbolic link to a directory
       for the target as a symbolic link instead of a directory.  This makes
       it possible to atomically update a symbolic link using rename().
    6. POSIX requires this behavior:
       if (exists and (NOT f_options) AND
         ((not_writable AND input_is_terminal) OR i_option)) then
         prompt
       This behavior was implemented.
    7. Passes all tests in suite.  Prior to change it failed 2 of 32 tests.

Summary of changes:
 bin/mv/mv.1                        |   33 +++--
 bin/mv/mv.c                        |  191 ++++++++++++++----------
 bin/mv/pathnames.h                 |   35 -----
 include/paths.h                    |    1 +
 tools/regression/bin/mv/Makefile   |    4 +
 tools/regression/bin/mv/regress.sh |  296 ++++++++++++++++++++++++++++++++++++
 tools/regression/bin/mv/regress.t  |    6 +
 7 files changed, 443 insertions(+), 123 deletions(-)
 delete mode 100644 bin/mv/pathnames.h
 create mode 100644 tools/regression/bin/mv/Makefile
 create mode 100644 tools/regression/bin/mv/regress.sh
 create mode 100644 tools/regression/bin/mv/regress.t

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/46c7fb85d65f149352ad0eeb4d067b97ff57ce9e


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]