[Libguestfs] [PATCH 2/2] lib/inspect-icon.c: Return error if guestfs_int_cmd_run has internal error.

Pino Toscano ptoscano at redhat.com
Fri Oct 6 13:12:45 UTC 2017


On Thursday, 5 October 2017 15:41:32 CEST Richard W.M. Jones wrote:
> This function returns -1 if things like fork(2) fail, so it is right
> to return an error here.  If the PBMTEXT command fails then that's a
> NOT_FOUND case.
> ---
>  lib/inspect-icon.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/inspect-icon.c b/lib/inspect-icon.c
> index 533e9fb4b..0edd3d1b0 100644
> --- a/lib/inspect-icon.c
> +++ b/lib/inspect-icon.c
> @@ -400,7 +400,7 @@ icon_cirros (guestfs_h *g, size_t *size_r)
>    guestfs_int_cmd_add_string_quoted   (cmd, pngfile);
>    r = guestfs_int_cmd_run (cmd);
>    if (r == -1)
> -    return NOT_FOUND;
> +    return NULL;
>    if (!WIFEXITED (r) || WEXITSTATUS (r) != 0)
>      return NOT_FOUND;

LGTM (it looks like this issue dates back to when the code was
introduced, even before CLEANUP_* & co).

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20171006/6bc37a6c/attachment.sig>


More information about the Libguestfs mailing list