fs-util: rename conservative_rename() -> conservative_renameat()

And this introduces conservative_rename() which does not take dirfd.
This commit is contained in:
Yu Watanabe
2021-01-22 12:55:54 +09:00
parent 9092113d93
commit 10195179bb
4 changed files with 14 additions and 11 deletions
+1 -1
View File
@@ -1614,7 +1614,7 @@ int path_is_encrypted(const char *path) {
return blockdev_is_encrypted(p, 10 /* safety net: maximum recursion depth */);
}
int conservative_rename(
int conservative_renameat(
int olddirfd, const char *oldpath,
int newdirfd, const char *newpath) {
+4 -1
View File
@@ -143,4 +143,7 @@ int open_parent(const char *path, int flags, mode_t mode);
int path_is_encrypted(const char *path);
int conservative_rename(int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
int conservative_renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
static inline int conservative_rename(const char *oldpath, const char *newpath) {
return conservative_renameat(AT_FDCWD, oldpath, AT_FDCWD, newpath);
}