#include <unistd.h>
#include <glib.h>
-#include <babeltrace/assert-internal.h>
-#include <babeltrace/fd-cache-internal.h>
+#include <babeltrace2/assert-internal.h>
+#include <babeltrace2/fd-cache-internal.h>
struct file_key {
uint64_t dev;
ret = stat(path, &statbuf);
if (ret < 0) {
- BT_LOGE_ERRNO("Failed to stat file", ": path=%s", path);
+ /*
+ * This is not necessarily an error as we sometimes try to open
+ * files to see if they exist. Log the error as DEBUG severity
+ * level.
+ */
+ BT_LOGD_ERRNO("Failed to stat file", ": path=%s", path);
goto end;
}
/*
* Use the device number and inode number to uniquely identify a file.
- * Even if the file as the same path, it may have been replaced so we
+ * Even if the file has the same path, it may have been replaced so we
* must open a new FD for it. This replacement of file is more likely
* to happen with a lttng-live source component.
*/
g_hash_table_insert(fdc->cache, fd_internal->key, fd_internal);
}
- BT_ASSERT(fd_internal->ref_count >= 0);
-
fd_internal->ref_count++;
goto end;