X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmodprobe.c;h=4c1ea67be18c50c4800c5ccf76374ee27e98f6b1;hp=a9035dab5766d167d1f0646befb4569f0de05974;hb=890d8fe47755c3bad936389cf48ffa141cff41c9;hpb=398d5459355620fc8ae40cebe27ca7bc2c1f7f44 diff --git a/src/bin/lttng-sessiond/modprobe.c b/src/bin/lttng-sessiond/modprobe.c index a9035dab5..4c1ea67be 100644 --- a/src/bin/lttng-sessiond/modprobe.c +++ b/src/bin/lttng-sessiond/modprobe.c @@ -16,7 +16,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include @@ -359,12 +358,12 @@ static int grow_probes(void) static int append_list_to_probes(const char *list) { char *next; - int index = nr_probes, ret; - char *tmp_list; + int ret; + char *tmp_list, *cur_list; assert(list); - tmp_list = strdup(list); + cur_list = tmp_list = strdup(list); if (!tmp_list) { PERROR("strdup temp list"); return -ENOMEM; @@ -374,11 +373,11 @@ static int append_list_to_probes(const char *list) size_t name_len; struct kern_modules_param *cur_mod; - next = strtok(tmp_list, ","); + next = strtok(cur_list, ","); if (!next) { break; } - tmp_list = NULL; + cur_list = NULL; /* filter leading spaces */ while (*next == ' ') { @@ -395,7 +394,7 @@ static int append_list_to_probes(const char *list) /* Length 13 is "lttng-probe-" + \0 */ name_len = strlen(next) + 13; - cur_mod = &probes[index]; + cur_mod = &probes[nr_probes]; cur_mod->name = zmalloc(name_len); if (!cur_mod->name) { PERROR("malloc probe list"); @@ -410,7 +409,6 @@ static int append_list_to_probes(const char *list) goto error; } - cur_mod++; nr_probes++; }