[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 3/4] febootstrap/helper/init: Fix wait() error handling



---
 helper/init.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/helper/init.c b/helper/init.c
index ac71018..40f0e43 100644
--- a/helper/init.c
+++ b/helper/init.c
@@ -228,10 +228,11 @@ insmod (const char *filename)
 
   /* Parent. */
   int status;
-  if (wait (&status) == -1 ||
-      WEXITSTATUS (status) != 0)
+  if (wait (&status) == -1)
     perror ("insmod: wait");
+  else if (WEXITSTATUS (status) != 0)
     /* but ignore the error, some will be because the device is not found */
+    fprintf (stderr, "insmod %s failed\n", filename);
 }
 
 /* Print contents of /proc/uptime. */
-- 
1.7.5.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]