Patchwork lib: fwts_pipeio: fwts_pipe_exec() should return FWTS_ERROR instead of -1

login
register
mail settings
Submitter Colin King
Date Dec. 7, 2012, 1:33 p.m.
Message ID <1354887207-15664-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/204486/
State Accepted
Headers show

Comments

Colin King - Dec. 7, 2012, 1:33 p.m.
From: Colin Ian King <colin.king@canonical.com>

fwts_pipe_exec() should be returning FWTS_ERROR instead -1. Note that
FWTS_ERROR is defined as -1, so this makes no real functional difference.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_pipeio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Keng-Yu Lin - Dec. 12, 2012, 3:06 a.m.
On Fri, Dec 7, 2012 at 9:33 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> fwts_pipe_exec() should be returning FWTS_ERROR instead -1. Note that
> FWTS_ERROR is defined as -1, so this makes no real functional difference.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_pipeio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c
> index cb6bd1e..68abee9 100644
> --- a/src/lib/src/fwts_pipeio.c
> +++ b/src/lib/src/fwts_pipeio.c
> @@ -143,7 +143,7 @@ int fwts_pipe_exec(const char *command, fwts_list **list)
>         int     ret;
>
>         if ((fd = fwts_pipe_open(command, &pid)) < 0)
> -               return -1;
> +               return FWTS_ERROR;
>
>         text = fwts_pipe_read(fd, &len);
>         *list = fwts_list_from_text(text);
> --
> 1.8.0
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Alex Hung - Dec. 12, 2012, 7:44 a.m.
On 12/07/2012 09:33 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> fwts_pipe_exec() should be returning FWTS_ERROR instead -1. Note that
> FWTS_ERROR is defined as -1, so this makes no real functional difference.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/src/fwts_pipeio.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c
> index cb6bd1e..68abee9 100644
> --- a/src/lib/src/fwts_pipeio.c
> +++ b/src/lib/src/fwts_pipeio.c
> @@ -143,7 +143,7 @@ int fwts_pipe_exec(const char *command, fwts_list **list)
>   	int	ret;
>
>   	if ((fd = fwts_pipe_open(command, &pid)) < 0)
> -		return -1;
> +		return FWTS_ERROR;
>
>   	text = fwts_pipe_read(fd, &len);
>   	*list = fwts_list_from_text(text);
>
Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c
index cb6bd1e..68abee9 100644
--- a/src/lib/src/fwts_pipeio.c
+++ b/src/lib/src/fwts_pipeio.c
@@ -143,7 +143,7 @@  int fwts_pipe_exec(const char *command, fwts_list **list)
 	int	ret;
 
 	if ((fd = fwts_pipe_open(command, &pid)) < 0)
-		return -1;
+		return FWTS_ERROR;
 
 	text = fwts_pipe_read(fd, &len);
 	*list = fwts_list_from_text(text);