Fix typos
[babeltrace.git] / src / common / common.h
index b447ec889e51fa68d2ed5963b073b95759aec8f2..f546b6314f3fb17b24f8b2fe6b427adb3955659b 100644 (file)
@@ -334,7 +334,7 @@ size_t bt_common_get_page_size(int log_level);
 /*
  * Adds the digit separator `sep` as many times as needed to form groups
  * of `digits_per_group` digits within `str`. `str` must have enough
- * room to accomodate the new separators, that is:
+ * room to accommodate the new separators, that is:
  *
  *     strlen(str) + (strlen(str) / digits_per_group) + 1
  *
@@ -378,13 +378,20 @@ int bt_common_append_file_content_to_g_string(GString *str, FILE *fp);
 
 void bt_common_abort(void) __attribute__((noreturn));
 
+#if (!defined(BT_LOG_WRITE_CUR_LVL) && !defined(BT_LOG_WRITE_ERRNO_CUR_LVL))
+#define BT_LOG_LEVEL_UNUSED_ATTR __attribute__((unused))
+#else
+#define BT_LOG_LEVEL_UNUSED_ATTR
+#endif
+
 /*
  * Wraps read() function to handle EINTR and partial reads.
  * On success, it returns `count` received as parameter. On error, it returns a
  * value smaller than the requested `count`.
  */
 static inline
-ssize_t bt_common_read(int fd, void *buf, size_t count, int log_level)
+ssize_t bt_common_read(int fd, void *buf, size_t count,
+               int log_level BT_LOG_LEVEL_UNUSED_ATTR)
 {
        size_t i = 0;
        ssize_t ret;
@@ -406,8 +413,8 @@ ssize_t bt_common_read(int fd, void *buf, size_t count, int log_level)
                                /* retry operation */
                                continue;
                        } else {
-#ifdef BT_LOG_WRITE_ERRNO_CUR_LVL
-                               BT_LOG_WRITE_ERRNO_CUR_LVL(BT_LOG_ERROR,
+#ifdef BT_LOG_WRITE_ERRNO_PRINTF_CUR_LVL
+                               BT_LOG_WRITE_ERRNO_PRINTF_CUR_LVL(BT_LOG_ERROR,
                                        log_level, BT_LOG_TAG,
                                        "Error while reading", ": fd=%d", fd);
 #endif
This page took 0.030036 seconds and 4 git commands to generate.