X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-registry.c;h=6913487d5611aef301313668612d70370d25d5b8;hp=80ea2e57054de736ac0801b01d4ed0bb8b0cb6a5;hb=3b016e589cc2229f0d3be8e6e61e8eeed8b7e9e6;hpb=10b56aefc3e1de5cee607994f64c3b8a7d85c391 diff --git a/src/bin/lttng-sessiond/ust-registry.c b/src/bin/lttng-sessiond/ust-registry.c index 80ea2e570..6913487d5 100644 --- a/src/bin/lttng-sessiond/ust-registry.c +++ b/src/bin/lttng-sessiond/ust-registry.c @@ -89,14 +89,23 @@ static int compare_enums(const struct ust_registry_enum *reg_enum_a, entries_a = ®_enum_a->entries[i]; entries_b = ®_enum_b->entries[i]; - if (entries_a->start != entries_b->start) { + if (entries_a->start.value != entries_b->start.value) { ret = -1; goto end; } - if (entries_a->end != entries_b->end) { + if (entries_a->end.value != entries_b->end.value) { ret = -1; goto end; } + if (entries_a->start.signedness != entries_b->start.signedness) { + ret = -1; + goto end; + } + if (entries_a->end.signedness != entries_b->end.signedness) { + ret = -1; + goto end; + } + if (strcmp(entries_a->string, entries_b->string)) { ret = -1; goto end; @@ -188,12 +197,22 @@ int validate_event_field(struct ustctl_field *field, const char *event_name, struct ust_app *app) { + int ret = 0; + switch(field->type.atype) { case ustctl_atype_integer: case ustctl_atype_enum: case ustctl_atype_array: case ustctl_atype_sequence: case ustctl_atype_string: + case ustctl_atype_variant: + break; + case ustctl_atype_struct: + if (field->type.u._struct.nr_fields != 0) { + WARN("Unsupported non-empty struct field."); + ret = -EINVAL; + goto end; + } break; case ustctl_atype_float: @@ -205,16 +224,19 @@ int validate_event_field(struct ustctl_field *field, field->type.u.basic._float.mant_dig, field->name, event_name); - return -EINVAL; + ret = -EINVAL; + goto end; default: break; } break; default: - return -ENOENT; + ret = -ENOENT; + goto end; } - return 0; +end: + return ret; } static @@ -847,6 +869,8 @@ int ust_registry_session_init(struct ust_registry_session **sessionp, session->uid = euid; session->gid = egid; session->next_enum_id = 0; + session->major = major; + session->minor = minor; strncpy(session->root_shm_path, root_shm_path, sizeof(session->root_shm_path)); session->root_shm_path[sizeof(session->root_shm_path) - 1] = '\0';