X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust-ctl%2Fustctl.c;h=01214eca60129650c12136205b294b9e1e1993c6;hb=8968a99fff433db0ce9268ed8f4107ddaf072186;hp=c2b761a1b7cccba3fea0fd0dfad2cc074036b45e;hpb=21a934df4c683e73e0a66a9afca33573fcf9d789;p=lttng-ust.git diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index c2b761a1..01214eca 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -16,15 +16,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE +#include #include +#include +#include + #include #include #include #include -#include -#include - +#include #include #include #include @@ -109,8 +110,10 @@ int ustctl_release_object(int sock, struct lttng_ust_object_data *data) ret = -errno; return ret; } + data->u.channel.wakeup_fd = -1; } free(data->u.channel.data); + data->u.channel.data = NULL; break; case LTTNG_UST_OBJECT_TYPE_STREAM: if (data->u.stream.shm_fd >= 0) { @@ -119,6 +122,7 @@ int ustctl_release_object(int sock, struct lttng_ust_object_data *data) ret = -errno; return ret; } + data->u.stream.shm_fd = -1; } if (data->u.stream.wakeup_fd >= 0) { ret = close(data->u.stream.wakeup_fd); @@ -126,6 +130,7 @@ int ustctl_release_object(int sock, struct lttng_ust_object_data *data) ret = -errno; return ret; } + data->u.stream.wakeup_fd = -1; } break; case LTTNG_UST_OBJECT_TYPE_EVENT: @@ -1451,7 +1456,7 @@ int ustctl_get_padded_subbuf_size(struct ustctl_consumer_stream *stream, chan = consumer_chan->chan->chan; *len = lib_ring_buffer_get_read_data_size(&chan->backend.config, buf, consumer_chan->chan->handle); - *len = PAGE_ALIGN(*len); + *len = LTTNG_UST_PAGE_ALIGN(*len); return 0; } @@ -1852,7 +1857,8 @@ int ustctl_recv_reg_msg(int sock, *uint64_t_alignment = reg_msg.uint64_t_alignment; *long_alignment = reg_msg.long_alignment; memcpy(name, reg_msg.name, LTTNG_UST_ABI_PROCNAME_LEN); - if (reg_msg.major != LTTNG_UST_ABI_MAJOR_VERSION) { + if (reg_msg.major < LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE || + reg_msg.major > LTTNG_UST_ABI_MAJOR_VERSION) { return -LTTNG_UST_ERR_UNSUP_MAJOR; }