More Rust

This commit is contained in:
topjohnwu
2022-08-19 02:21:52 -07:00
parent 2d8beabbd4
commit 34dd9eb7d6
9 changed files with 172 additions and 108 deletions

View File

@@ -124,7 +124,7 @@ void mv_dir(int src, int dest) {
for (dirent *entry; (entry = xreaddir(dir.get()));) {
switch (entry->d_type) {
case DT_DIR:
if (xfaccessat(dest, entry->d_name) == 0) {
if (xfaccessat(dest, entry->d_name, F_OK, 0) == 0) {
// Destination folder exists, needs recursive move
int newsrc = xopenat(src, entry->d_name, O_RDONLY | O_CLOEXEC);
int newdest = xopenat(dest, entry->d_name, O_RDONLY | O_CLOEXEC);