summaryrefslogtreecommitdiff
path: root/glnx-shutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'glnx-shutil.c')
-rw-r--r--glnx-shutil.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/glnx-shutil.c b/glnx-shutil.c
index 9fcb65a..967e364 100644
--- a/glnx-shutil.c
+++ b/glnx-shutil.c
@@ -118,7 +118,7 @@ glnx_shutil_rm_rf_children (GLnxDirFdIterator *dfd_iter,
/**
* glnx_shutil_rm_rf_at:
- * @dfd: A directory file descriptor, or -1 for current
+ * @dfd: A directory file descriptor, or `AT_FDCWD` or `-1` for current
* @path: Path
* @cancellable: Cancellable
* @error: Error
@@ -137,6 +137,8 @@ glnx_shutil_rm_rf_at (int dfd,
glnx_fd_close int target_dfd = -1;
g_auto(GLnxDirFdIterator) dfd_iter = { 0, };
+ dfd = glnx_dirfd_canonicalize (dfd);
+
/* With O_NOFOLLOW first */
target_dfd = openat (dfd, path,
O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW);