projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: lttng-ctl: deserialize on orderly shutdown of sessiond
[lttng-tools.git]
/
src
/
common
/
trigger.c
diff --git
a/src/common/trigger.c
b/src/common/trigger.c
index 234691e4a6d5ae2da5d92ee2f0edc3cd0fd0ad9d..e038fa81a052d71fe3952afaae96c96982a23ae3 100644
(file)
--- a/
src/common/trigger.c
+++ b/
src/common/trigger.c
@@
-129,7
+129,7
@@
void lttng_trigger_destroy(struct lttng_trigger *trigger)
LTTNG_HIDDEN
ssize_t lttng_trigger_create_from_payload(
struct lttng_payload_view *src_view,
LTTNG_HIDDEN
ssize_t lttng_trigger_create_from_payload(
struct lttng_payload_view *src_view,
- struct lttng_trigger **trigger)
+ struct lttng_trigger **
_
trigger)
{
ssize_t ret, offset = 0, condition_size, action_size, name_size = 0;
struct lttng_condition *condition = NULL;
{
ssize_t ret, offset = 0, condition_size, action_size, name_size = 0;
struct lttng_condition *condition = NULL;
@@
-140,11
+140,12
@@
ssize_t lttng_trigger_create_from_payload(
.uid = LTTNG_OPTIONAL_INIT_UNSET,
.gid = LTTNG_OPTIONAL_INIT_UNSET,
};
.uid = LTTNG_OPTIONAL_INIT_UNSET,
.gid = LTTNG_OPTIONAL_INIT_UNSET,
};
+ struct lttng_trigger *trigger = NULL;
const struct lttng_payload_view trigger_comm_view =
lttng_payload_view_from_view(
src_view, 0, sizeof(*trigger_comm));
const struct lttng_payload_view trigger_comm_view =
lttng_payload_view_from_view(
src_view, 0, sizeof(*trigger_comm));
- if (!src_view || !trigger) {
+ if (!src_view || !
_
trigger) {
ret = -1;
goto end;
}
ret = -1;
goto end;
}
@@
-229,13
+230,13
@@
ssize_t lttng_trigger_create_from_payload(
goto error;
}
goto error;
}
-
*
trigger = lttng_trigger_create(condition, action);
- if (!
*
trigger) {
+ trigger = lttng_trigger_create(condition, action);
+ if (!trigger) {
ret = -1;
goto error;
}
ret = -1;
goto error;
}
- lttng_trigger_set_credentials(
*
trigger, &creds);
+ lttng_trigger_set_credentials(trigger, &creds);
/*
* The trigger object owns references to the action and condition
/*
* The trigger object owns references to the action and condition
@@
-249,7
+250,7
@@
ssize_t lttng_trigger_create_from_payload(
if (name) {
const enum lttng_trigger_status status =
if (name) {
const enum lttng_trigger_status status =
- lttng_trigger_set_name(
*
trigger, name);
+ lttng_trigger_set_name(trigger, name);
if (status != LTTNG_TRIGGER_STATUS_OK) {
ret = -1;
if (status != LTTNG_TRIGGER_STATUS_OK) {
ret = -1;
@@
-263,6
+264,12
@@
error:
lttng_condition_put(condition);
lttng_action_put(action);
end:
lttng_condition_put(condition);
lttng_action_put(action);
end:
+ if (ret >= 0) {
+ *_trigger = trigger;
+ } else {
+ lttng_trigger_put(trigger);
+ }
+
return ret;
}
return ret;
}
This page took
0.024354 seconds
and
4
git commands to generate.