projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup: firing policy source files
[lttng-tools.git]
/
src
/
common
/
actions
/
path.c
diff --git
a/src/common/actions/path.c
b/src/common/actions/path.c
index 7f4955475aa9775f9001e9a34aebca0e5b864874..9e1b448a6e20a9a6a6ac48ea1965c608bbc82900 100644
(file)
--- a/
src/common/actions/path.c
+++ b/
src/common/actions/path.c
@@
-102,8
+102,8
@@
int lttng_action_path_copy(const struct lttng_action_path *src,
int ret;
size_t i, src_count;
int ret;
size_t i, src_count;
-
assert
(src);
-
assert
(dst);
+
LTTNG_ASSERT
(src);
+
LTTNG_ASSERT
(dst);
lttng_dynamic_array_init(&dst->indexes, sizeof(uint64_t), NULL);
src_count = lttng_dynamic_array_get_count(&src->indexes);
lttng_dynamic_array_init(&dst->indexes, sizeof(uint64_t), NULL);
src_count = lttng_dynamic_array_get_count(&src->indexes);
@@
-143,6
+143,13
@@
ssize_t lttng_action_path_create_from_payload(
header = (typeof(header)) header_view.buffer.data;
consumed_size += header_view.buffer.size;
header = (typeof(header)) header_view.buffer.data;
consumed_size += header_view.buffer.size;
+
+ /*
+ * An action path of size 0 can exist and represents a trigger with a
+ * single non-list action. Handle it differently since a payload view of
+ * size 0 is considered invalid.
+ */
+ if (header->index_count != 0)
{
const struct lttng_payload_view indexes_view =
lttng_payload_view_from_view(view,
{
const struct lttng_payload_view indexes_view =
lttng_payload_view_from_view(view,
@@
-161,6
+168,11
@@
ssize_t lttng_action_path_create_from_payload(
if (!action_path) {
goto end;
}
if (!action_path) {
goto end;
}
+ } else {
+ action_path = lttng_action_path_create(NULL, 0);
+ if (!action_path) {
+ goto end;
+ }
}
ret = consumed_size;
}
ret = consumed_size;
This page took
0.023283 seconds
and
4
git commands to generate.