[Libguestfs] [PATCH 1/6] tail: check the return value pf guestfs_set_pgroup

Pino Toscano ptoscano at redhat.com
Mon Mar 6 14:42:46 UTC 2017


It is done when creating the handle, so do it also when duplicating the
handle.
---
 cat/tail.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cat/tail.c b/cat/tail.c
index 51da5fc..ef5bbb1 100644
--- a/cat/tail.c
+++ b/cat/tail.c
@@ -495,7 +495,10 @@ reopen_handle (void)
 
   guestfs_set_verbose (g2, guestfs_get_verbose (g));
   guestfs_set_trace (g2, guestfs_get_trace (g));
-  guestfs_set_pgroup (g2, guestfs_get_pgroup (g));
+  if (guestfs_set_pgroup (g2, guestfs_get_pgroup (g)) == -1) {
+    perror ("guestfs_set_pgroup");
+    return -1;
+  }
 
   guestfs_close (g);
   g = g2;
-- 
2.9.3




More information about the Libguestfs mailing list