HomeFreeBSD

cp: Refactor the core logic.

Description

cp: Refactor the core logic.

Rewrite copy_file() so the lflag and sflag are handled as early as
possible instead of constantly checking that they're not set and then
handling them at the end. This also opens the door to changing the
failure logic at some future point (for instance, we might decide to
fall back to copying if errno indicates that the file system does not
support links).

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, allanjude
Differential Revision: https://reviews.freebsd.org/D43055

Details

Provenance
desAuthored on Dec 13 2023, 11:40 PM
Reviewer
kevans
Differential Revision
D43055: cp: Refactor the core logic.
Parents
rGd3a8e9b43b4c: cp: Add tests for symbolic link case.
Branches
Unknown
Tags
Unknown