tap-driver.sh: flush stdout after each test result
[babeltrace.git] / fd-cache / fd-cache.c
index dcb4f59802e9bd5460236ac377c7da055ef4323b..fcd4f4c201b4bbc9620d1dfb392debd18d1661da 100644 (file)
@@ -35,8 +35,8 @@
 #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;
@@ -139,13 +139,18 @@ struct bt_fd_cache_handle *bt_fd_cache_get_handle(struct bt_fd_cache *fdc,
 
        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.
         */
@@ -184,8 +189,6 @@ struct bt_fd_cache_handle *bt_fd_cache_get_handle(struct bt_fd_cache *fdc,
                g_hash_table_insert(fdc->cache, fd_internal->key, fd_internal);
        }
 
-       BT_ASSERT(fd_internal->ref_count >= 0);
-
        fd_internal->ref_count++;
        goto end;
 
This page took 0.023602 seconds and 4 git commands to generate.