Re: [PATCH v3 5/7] trace-cmd: Refactored make_instances() and tracecmd_remove_instances()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri,  8 Feb 2019 15:49:16 +0200
Tzvetomir Stoyanov <tstoyanov@xxxxxxxxxx> wrote:

> +static void tracecmd_remove_one_instance(struct buffer_instance *instance)
> +{
> +	char *path;
> +
> +	if (instance->tracing_on_fd > 0) {
> +		close(instance->tracing_on_fd);
> +		instance->tracing_on_fd = 0;

Also note that uninitialized file descriptors should be a negative
number (-1), because zero is a valid descriptor value.

-- Steve

>  	}
> +	path = get_instance_dir(instance);
> +	tracecmd_put_tracing_file(path);
>  }
>  



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux