*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <assert.h>
#include <ctype.h>
#include <fcntl.h>
/* Cut the part we will be trying to resolve */
cut_path = strndup(path, next - path);
+ if (cut_path == NULL) {
+ PERROR("strndup");
+ goto error;
+ }
/* Try to resolve this part */
try_path = realpath((char *)cut_path, NULL);
* path are pointers for the same memory space
*/
cut_path = strdup(prev);
+ if (cut_path == NULL) {
+ PERROR("strdup");
+ goto error;
+ }
/* Concatenate the strings */
snprintf(resolved_path, size, "%s%s", try_path_prev, cut_path);
/* We prepare the start_path not containing it */
start_path = strndup(absolute_path, next - absolute_path);
-
+ if (!start_path) {
+ PERROR("strndup");
+ goto error;
+ }
/* And we concatenate it with the part after this string */
snprintf(absolute_path, PATH_MAX, "%s%s", start_path, next + 2);
/* Then we prepare the start_path not containing it */
start_path = strndup(absolute_path, previous - absolute_path);
+ if (!start_path) {
+ PERROR("strndup");
+ goto error;
+ }
/* And we concatenate it with the part after the '/../' */
snprintf(absolute_path, PATH_MAX, "%s%s", start_path, next + 4);
/*
* Obtain the value of LTTNG_KMOD_PROBES environment variable, if exists.
- * Otherwise returns an empty string.
+ * Otherwise returns NULL.
*/
LTTNG_HIDDEN
char *utils_get_kmod_probes_list(void)
return getenv(DEFAULT_LTTNG_KMOD_PROBES);
}
+/*
+ * Obtain the value of LTTNG_EXTRA_KMOD_PROBES environment variable, if
+ * exists. Otherwise returns NULL.
+ */
+LTTNG_HIDDEN
+char *utils_get_extra_kmod_probes_list(void)
+{
+ return getenv(DEFAULT_LTTNG_EXTRA_KMOD_PROBES);
+}
+
/*
* With the given format, fill dst with the time of len maximum siz.
*