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

Richard W.M. Jones rjones at redhat.com
Thu Oct 5 13:41:32 UTC 2017


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;
 
-- 
2.13.2




More information about the Libguestfs mailing list