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>
Mon, 6 Apr 2020 14:35:37 +0000 (10:35 -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 95be9ec3d7cfeada460dad1238e1ca06dac53695..4d6f0c6ba8be6cb9c72755d26aa758ec844b07b5 100644 (file)
@@ -292,7 +292,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.02723 seconds and 4 git commands to generate.