[lttng-dev] [lttng-tools PATCH v2 1/4] Always add the executable name to consumerd32/64_path

Alexandre Montplaisir alexandre.montplaisir at gmail.com
Mon Dec 5 13:38:19 EST 2011


>> 	/*
>>  	 * Allow INSTALL_BIN_PATH to be used as a target path for the
>> @@ -213,20 +214,39 @@ void setup_consumerd_path(void)
>>  	 */
>>  	path = getenv("LTTNG_CONSUMERD32_PATH");
>>  	if (path) {
>> -		consumerd32_path = path;
>> +		ret = asprintf((char**)&consumerd32_path, "%s/" CONSUMERD_FILE, path);
> This cast tells me something is wrong. I'll let David reply.
>
> Thanks,
>
> Mathieu
>

In fact David suggested this ;)
Perhaps a "cleaner" option would be to use

char *tmp_path;
asprintf(&tmp_path,...);
consumerd32_path = tmp_path;

but using the cast avoids the need for a temporary variable.



More information about the lttng-dev mailing list