Enable channel lttng API call now forbids the use of NULL pointer for
channel attributes.
Use lttng_channel_set_default_attr() before.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
{
struct lttcomm_session_msg lsm;
{
struct lttcomm_session_msg lsm;
- if (!handle || ev == NULL) {
+ if (handle == NULL || ev == NULL) {
+ /* If no channel name, we put the default name */
if (channel_name == NULL) {
copy_string(lsm.u.enable.channel_name, DEFAULT_CHANNEL_NAME,
sizeof(lsm.u.enable.channel_name));
if (channel_name == NULL) {
copy_string(lsm.u.enable.channel_name, DEFAULT_CHANNEL_NAME,
sizeof(lsm.u.enable.channel_name));
{
struct lttcomm_session_msg lsm;
{
struct lttcomm_session_msg lsm;
+ /*
+ * NULL arguments are forbidden. No default values.
+ */
+ if (handle == NULL || chan == NULL) {
- if (chan) {
- memcpy(&lsm.u.channel.chan, chan, sizeof(lsm.u.channel.chan));
- }
+ memcpy(&lsm.u.channel.chan, chan, sizeof(lsm.u.channel.chan));
lsm.cmd_type = LTTNG_ENABLE_CHANNEL;
lsm.cmd_type = LTTNG_ENABLE_CHANNEL;