]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
cp: Improved conformance when copying directories.
authorDag-Erling Smørgrav <des@FreeBSD.org>
Mon, 1 Apr 2024 17:28:58 +0000 (19:28 +0200)
committerDag-Erling Smørgrav <des@FreeBSD.org>
Mon, 1 Apr 2024 17:29:31 +0000 (19:29 +0200)
commitdd286b0dc187c351a9537a363840245d5505b15b
tree22fec380d22e31551541ee9b2a6eaaa3f37b2247
parentaaa1806f68ef3102a9b888a03360f166b88618c8
cp: Improved conformance when copying directories.

* When copying a directory, if the destination exists and is not a
  directory, we would previously emit an error message and exit.  The
  correct behavior according to POSIX is to emit an error message and
  continue without descending further into the source directory.

* When copying a directory, if the destination does not exist and we
  fail to create it, we would previously emit an error message and
  exit.  The correct behavior according to POSIX is to emit an error
  message and continue.  Whether to descend further into the source
  directory is explicitly left unspecified; GNU cp does not, which
  seems to me to be the safer and less surprising option, so let's not
  either.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D44577
bin/cp/cp.c