daemon: Handle EXDEV when moving to trash directory.
authorChris Marusich <cmmarusich@gmail.com>
Fri, 5 Jun 2020 06:26:19 +0000 (23:26 -0700)
committerChris Marusich <cmmarusich@gmail.com>
Sat, 6 Jun 2020 22:43:35 +0000 (15:43 -0700)
commitd445c30ea6f9693454ca96bae9089ba8738a6f78
tree25a4cccb66ef31337f3c6673508e0674235003de
parentc39693d76099c159df856ffb5b2c43765fd6f2dd
daemon: Handle EXDEV when moving to trash directory.

Fixes <https://bugs.gnu.org/41607>.
Reported by Stephen Scheck <singularsyntax@gmail.com>.

* nix/libstore/gc.cc (LocalStore::deletePathRecursive): When we try to
move a dead directory into the trashDir using rename(2) but it returns
an EXDEV error, just delete the directory instead.  This can happen in a
Docker container when the directory is not on the "top layer".
nix/libstore/gc.cc