Message ID | 20180131101741.22353-1-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | lib: fwts_pipeio: remove variable status | expand |
On 2018-01-31 02:17 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Clean up code, we can remove variable status > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_pipeio.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c > index 76d7ffc2..60030dee 100644 > --- a/src/lib/src/fwts_pipeio.c > +++ b/src/lib/src/fwts_pipeio.c > @@ -333,7 +333,7 @@ int fwts_exec(const char *command, int *status) > int fwts_exec2(const char *command, char **output) > { > pid_t pid; > - int status = -1, in_fd, out_fd; > + int in_fd, out_fd; > ssize_t out_len; > > if (fwts_pipe_open_rw(command, &pid, > @@ -347,9 +347,7 @@ int fwts_exec2(const char *command, char **output) > return -1; > } > > - status = fwts_pipe_close2(in_fd, out_fd, pid); > - > - return status; > + return fwts_pipe_close2(in_fd, out_fd, pid); > } > > /* > Acked-by: Alex Hung <alex.hung@canonical.com>
On 01/31/2018 06:17 PM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Clean up code, we can remove variable status > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_pipeio.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c > index 76d7ffc2..60030dee 100644 > --- a/src/lib/src/fwts_pipeio.c > +++ b/src/lib/src/fwts_pipeio.c > @@ -333,7 +333,7 @@ int fwts_exec(const char *command, int *status) > int fwts_exec2(const char *command, char **output) > { > pid_t pid; > - int status = -1, in_fd, out_fd; > + int in_fd, out_fd; > ssize_t out_len; > > if (fwts_pipe_open_rw(command, &pid, > @@ -347,9 +347,7 @@ int fwts_exec2(const char *command, char **output) > return -1; > } > > - status = fwts_pipe_close2(in_fd, out_fd, pid); > - > - return status; > + return fwts_pipe_close2(in_fd, out_fd, pid); > } > > /* Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c index 76d7ffc2..60030dee 100644 --- a/src/lib/src/fwts_pipeio.c +++ b/src/lib/src/fwts_pipeio.c @@ -333,7 +333,7 @@ int fwts_exec(const char *command, int *status) int fwts_exec2(const char *command, char **output) { pid_t pid; - int status = -1, in_fd, out_fd; + int in_fd, out_fd; ssize_t out_len; if (fwts_pipe_open_rw(command, &pid, @@ -347,9 +347,7 @@ int fwts_exec2(const char *command, char **output) return -1; } - status = fwts_pipe_close2(in_fd, out_fd, pid); - - return status; + return fwts_pipe_close2(in_fd, out_fd, pid); } /*