static
void lttng_directory_handle_release(struct urcu_ref *ref);
-#ifdef COMPAT_DIRFD
+#ifdef HAVE_DIRFD
/*
* Special inode number reserved to represent the "current working directory".
if (ret) {
PERROR("Failed to fstat directory file descriptor %i", dirfd);
lttng_directory_handle_release(&handle->ref);
+ handle = NULL;
+ goto end;
}
} else {
handle->directory_inode = RESERVED_AT_FDCWD_INO;
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
return run_as_rmdirat_recursive(handle->dirfd, name, uid, gid, flags);
}
-#else /* COMPAT_DIRFD */
+#else /* HAVE_DIRFD */
static
int get_full_path(const struct lttng_directory_handle *handle,
return ret;
}
-#endif /* COMPAT_DIRFD */
+#endif /* HAVE_DIRFD */
/* Common implementation. */