summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-07-03 10:11:33 +0200
committerLennart Poettering <lennart@poettering.net>2015-07-03 10:11:33 +0200
commit200edc2bcfdf3845ee8ee5c71306dfbe20dc28d3 (patch)
tree8806ea75624d8d69755cbbb4e27f92cbf9f50b3c
parenta92a81d86a85fc3e8f8632eb6a3daed6e8001612 (diff)
parent715d7599051602471d4a54bbc00639d32ddaaae2 (diff)
Merge pull request #473 from richardmaw-codethink/machinectl-import-earlier-than-3-15
util: fall back in rename_noreplace when renameat2 isn't implemented
-rw-r--r--src/basic/util.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/basic/util.c b/src/basic/util.c
index 906e4abad6..aa912bde28 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -5925,10 +5925,9 @@ int rename_noreplace(int olddirfd, const char *oldpath, int newdirfd, const char
if (ret >= 0)
return 0;
- /* Even though renameat2() exists since Linux 3.15, btrfs added
- * support for it later. If it is not implemented, fallback to another
- * method. */
- if (errno != EINVAL)
+ /* renameat2() exists since Linux 3.15, btrfs added support for it later.
+ * If it is not implemented, fallback to another method. */
+ if (!IN_SET(errno, EINVAL, ENOSYS))
return -errno;
/* The link()/unlink() fallback does not work on directories. But