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 17:44:09 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> 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.

Bah, nevermind. Looks like I was a bit more lenient back in the day...

d56f30679 trace-record.c          (Steven Rostedt (Red Hat)    2013-03-06 11:31:39 -0500 1938)  /* OK, we keep zero for stdin */
d56f30679 trace-record.c          (Steven Rostedt (Red Hat)    2013-03-06 11:31:39 -0500 1939)  if (fd > 0)
6e7c1dd76 trace-record.c          (Steven Rostedt              2011-02-23 13:28:04 -0500 1940)          return fd;


  ;-)

-- Steve




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

  Powered by Linux