#include <lttng/constant.h>
#include <common/dynamic-array.h>
-#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
struct lttng_directory_handle *new_handle = NULL;
char *new_path = NULL;
- assert(ref_handle && ref_handle->base_path);
+ LTTNG_ASSERT(ref_handle && ref_handle->base_path);
ret = lttng_directory_handle_stat(ref_handle, path, &stat_buf);
if (ret == -1) {
struct lttng_directory_handle *lttng_directory_handle_create_from_dirfd(
int dirfd)
{
- assert(dirfd == AT_FDCWD);
+ LTTNG_ASSERT(dirfd == AT_FDCWD);
return lttng_directory_handle_create(NULL);
}
size_t len;
int ret;
- assert(path);
+ LTTNG_ASSERT(path);
ret = lttng_strncpy(tmp, path, sizeof(tmp));
if (ret) {
if (!handle) {
return;
}
- assert(handle->ref.refcount);
+ LTTNG_ASSERT(handle->ref.refcount);
urcu_ref_put(&handle->ref, lttng_directory_handle_release);
}
lttng_dynamic_array_get_element(
&frames, current_frame_idx);
- assert(current_frame->dir);
+ LTTNG_ASSERT(current_frame->dir);
ret = lttng_dynamic_buffer_set_size(
¤t_path, current_frame->path_size);
- assert(!ret);
+ LTTNG_ASSERT(!ret);
current_path.data[current_path.size - 1] = '\0';
while ((entry = readdir(current_frame->dir))) {
/* Set current_path to the entry's path. */
ret = lttng_dynamic_buffer_set_size(
¤t_path, current_path.size - 1);
- assert(!ret);
+ LTTNG_ASSERT(!ret);
ret = lttng_dynamic_buffer_append(¤t_path,
&separator, sizeof(separator));
if (ret) {
parent_frame = lttng_dynamic_array_get_element(&frames,
current_frame->parent_frame_idx);
- assert(parent_frame);
+ LTTNG_ASSERT(parent_frame);
parent_frame->empty = false;
}
ret = lttng_dynamic_array_remove_element(