Re: [PATCH 6/8] trace-cmd: Make tracecmd_msg_send_close return error code if any

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

 



On Mon,  4 Feb 2019 09:08:53 +0200
Slavomir Kaslev <kaslevs@xxxxxxxxxx> wrote:

I accepted your patches up to here with some slight modifications to
the subjects and change logs. Note, when referencing function names,
its mostly desirable to add a "()" to the end of them to make it stand
out that they are functions. Like tracecmd_msg_send_close().

But, this patch needs a change log to explain why this function should
return an error code. Is something going to rely on it in the future?

-- Steve



> Signed-off-by: Slavomir Kaslev <kaslevs@xxxxxxxxxx>
> ---
>  include/trace-cmd/trace-cmd.h | 2 +-
>  tracecmd/trace-msg.c          | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/trace-cmd/trace-cmd.h b/include/trace-cmd/trace-cmd.h
> index 33f352b..0ab23f6 100644
> --- a/include/trace-cmd/trace-cmd.h
> +++ b/include/trace-cmd/trace-cmd.h
> @@ -318,7 +318,7 @@ int tracecmd_msg_send_init_data(struct tracecmd_msg_handle *msg_handle,
>  int tracecmd_msg_data_send(struct tracecmd_msg_handle *msg_handle,
>  			       const char *buf, int size);
>  int tracecmd_msg_finish_sending_data(struct tracecmd_msg_handle *msg_handle);
> -void tracecmd_msg_send_close_msg(struct tracecmd_msg_handle *msg_handle);
> +int tracecmd_msg_send_close_msg(struct tracecmd_msg_handle *msg_handle);
>  
>  /* for server */
>  int tracecmd_msg_initial_setting(struct tracecmd_msg_handle *msg_handle);
> diff --git a/tracecmd/trace-msg.c b/tracecmd/trace-msg.c
> index b4b58d4..c24424b 100644
> --- a/tracecmd/trace-msg.c
> +++ b/tracecmd/trace-msg.c
> @@ -549,12 +549,12 @@ int tracecmd_msg_send_port_array(struct tracecmd_msg_handle *msg_handle,
>  	return 0;
>  }
>  
> -void tracecmd_msg_send_close_msg(struct tracecmd_msg_handle *msg_handle)
> +int tracecmd_msg_send_close_msg(struct tracecmd_msg_handle *msg_handle)
>  {
>  	struct tracecmd_msg msg;
>  
>  	tracecmd_msg_init(MSG_CLOSE, &msg);
> -	tracecmd_msg_send(msg_handle->fd, &msg);
> +	return tracecmd_msg_send(msg_handle->fd, &msg);
>  }
>  
>  int tracecmd_msg_data_send(struct tracecmd_msg_handle *msg_handle,




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

  Powered by Linux