directory-handle: print `errno` reason on `unlinkat()` error
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Mon, 9 Mar 2020 14:49:51 +0000 (10:49 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 17 Mar 2020 17:21:40 +0000 (13:21 -0400)
This is helpful while troubleshooting clear and rotation issues.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I92f9551a49fced7603c8dca832566de71b188528

src/common/compat/directory-handle.c

index a790c5b79960d7933efe4221949070698b59eea9..aea4be5fe27ffc54e3c9c873fa36209317cb2ba9 100644 (file)
@@ -355,7 +355,12 @@ static
 int lttng_directory_handle_rmdir(
                const struct lttng_directory_handle *handle, const char *name)
 {
-       return unlinkat(handle->dirfd, name, AT_REMOVEDIR);
+       int ret = unlinkat(handle->dirfd, name, AT_REMOVEDIR);
+       if (ret) {
+               PERROR("Failed to remove directory `%s`", name);
+       }
+
+       return ret;
 }
 
 static
This page took 0.040321 seconds and 4 git commands to generate.