lib: use dedicated BT_LOG*_ERRNO() instead of using strerror()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 4 Jul 2017 20:15:04 +0000 (16:15 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 6 Jul 2017 21:13:04 +0000 (17:13 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/ctf-ir/fields.c
lib/ctf-ir/stream.c

index 3ee3b9502dce12f0a45eceb1e6080b57938aced6..9599b5bd9d42d0fe055434f13007e3f9cdd44426 100644 (file)
@@ -3036,8 +3036,8 @@ int increase_packet_size(struct bt_ctf_stream_pos *pos)
                pos->offset, pos->packet_size);
        ret = munmap_align(pos->base_mma);
        if (ret) {
-               BT_LOGE("Failed to perform an aligned memory unmapping: "
-                       "ret=%d, errno=%d", ret, errno);
+               BT_LOGE_ERRNO("Failed to perform an aligned memory unmapping",
+                       ": ret=%d", ret);
                goto end;
        }
 
@@ -3047,8 +3047,8 @@ int increase_packet_size(struct bt_ctf_stream_pos *pos)
                        pos->packet_size / CHAR_BIT);
        } while (ret == EINTR);
        if (ret) {
-               BT_LOGE("Failed to preallocate memory space: ret=%d, errno=%d",
-                       ret, errno);
+               BT_LOGE_ERRNO("Failed to preallocate memory space",
+                       ": ret=%d", ret);
                errno = EINTR;
                ret = -1;
                goto end;
@@ -3057,8 +3057,8 @@ int increase_packet_size(struct bt_ctf_stream_pos *pos)
        pos->base_mma = mmap_align(pos->packet_size / CHAR_BIT, pos->prot,
                pos->flags, pos->fd, pos->mmap_offset);
        if (pos->base_mma == MAP_FAILED) {
-               BT_LOGE("Failed to perform an aligned memory mapping: "
-                       "ret=%d, errno=%d", ret, errno);
+               BT_LOGE_ERRNO("Failed to perform an aligned memory mapping",
+                       ": ret=%d", ret);
                ret = -1;
        }
 
index 1c3d534f30ed3c122112dd90188cc88c6c931863..f13c024a3f230628853a5730c826c113b2bc6834 100644 (file)
@@ -731,10 +731,9 @@ append_ids:
                S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
        g_free(file_path);
        if (fd < 0) {
-               BT_LOGW("Failed to open stream file for writing: %s: "
-                       "filename=\"%s\", "
-                       "ret=%d, errno=%d", strerror(errno),
-                       filename->str, fd, errno);
+               BT_LOGW_ERRNO("Failed to open stream file for writing",
+                       ": file_path=\"%s\", filename=\"%s\", ret=%d",
+                       file_path, filename->str, fd);
                goto end;
        }
 
@@ -1795,16 +1794,14 @@ void bt_ctf_stream_destroy(struct bt_object *obj)
                        ret = ftruncate(stream->pos.fd, stream->size);
                } while (ret == -1 && errno == EINTR);
                if (ret) {
-                       BT_LOGE("Failed to truncate stream file: %s: "
-                               "ret=%d, errno=%d, size=%" PRIu64,
-                               strerror(errno), ret, errno,
-                               (uint64_t) stream->size);
+                       BT_LOGE_ERRNO("Failed to truncate stream file",
+                               ": ret=%d, size=%" PRIu64,
+                               ret, (uint64_t) stream->size);
                }
 
                if (close(stream->pos.fd)) {
-                       BT_LOGE("Failed to close stream file: %s: "
-                               "ret=%d, errno=%d", strerror(errno),
-                               ret, errno);
+                       BT_LOGE_ERRNO("Failed to close stream file",
+                               ": ret=%d", ret);
                }
        }
 
This page took 0.027753 seconds and 4 git commands to generate.