From a104c538199392831f0cde6d8e9a052e415765860dd618dd20b3ff0d19ac8958 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Wed, 16 Jun 2021 14:06:39 +0000 Subject: [PATCH] Accepting request 900395 from home:lnussel:usrmove - unsafe fallback also for ENOSYS on renameat2 as seen on WSL OBS-URL: https://build.opensuse.org/request/show/900395 OBS-URL: https://build.opensuse.org/package/show/Base:System/compat-usrmerge?expand=0&rev=20 --- compat-usrmerge.changes | 1 + xmv.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/compat-usrmerge.changes b/compat-usrmerge.changes index 6d79ad4..f612632 100644 --- a/compat-usrmerge.changes +++ b/compat-usrmerge.changes @@ -2,6 +2,7 @@ Tue Jun 15 15:27:41 UTC 2021 - Ludwig Nussel - another fix for split /usr to avoid running out of space (boo#1186781) +- unsafe fallback also for ENOSYS on renameat2 as seen on WSL ------------------------------------------------------------------- Tue Jun 8 12:03:52 UTC 2021 - Ludwig Nussel diff --git a/xmv.c b/xmv.c index d3bc20d..cdddb95 100644 --- a/xmv.c +++ b/xmv.c @@ -70,7 +70,9 @@ int main(int argc, char** argv) const char *source = argv[optind], *target = argv[optind+1]; r = syscall (SYS_renameat2, AT_FDCWD, source, AT_FDCWD, target, RENAME_EXCHANGE); if (r < 0) { - if (errno != EINVAL) { + // FS not supporting RENAME_EXCHANGE -> EINVAL + // No renameat2 syscall -> ENOSYS (eg WSL) + if (errno != EINVAL && errno != ENOSYS) { perror("renameat2"); return 1; }