Add the sessiond notification-handling subsystem
[lttng-tools.git] / src / bin / lttng-sessiond / save.c
index 489446d6311dc4d8048f5f525cf91fcab1e7eaa9..1a879b21429892e1f1af1465af9c790b5f7270b5 100644 (file)
@@ -708,7 +708,11 @@ int init_ust_event_from_agent_event(struct ltt_ust_event *ust_event,
 
        ust_event->enabled = agent_event->enabled;
        ust_event->attr.instrumentation = LTTNG_UST_TRACEPOINT;
-       strncpy(ust_event->attr.name, agent_event->name, LTTNG_SYMBOL_NAME_LEN);
+       if (lttng_strncpy(ust_event->attr.name, agent_event->name,
+                       LTTNG_SYMBOL_NAME_LEN)) {
+               ret = -1;
+               goto end;
+       }
        switch (agent_event->loglevel_type) {
        case LTTNG_EVENT_LOGLEVEL_ALL:
                ust_loglevel_type = LTTNG_UST_LOGLEVEL_ALL;
@@ -2049,6 +2053,13 @@ end:
                }
        }
 
+       if (file_opened) {
+               ret = close(fd);
+               if (ret) {
+                       PERROR("Closing XML session configuration");
+               }
+       }
+
        return ret;
 }
 
This page took 0.024585 seconds and 5 git commands to generate.