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

[Xen-devel] [PATCH 1/5] xl: remove needless error checking from calls to xl_fork



xl_fork cannot fail - it exits instead.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 8990020..e19b1cf 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -230,10 +230,7 @@ static void autoconnect_vncviewer(uint32_t domid, int 
autopass)
     vncviewer_child_report();
 
     pid_t pid = xl_fork(child_vncviewer);
-    if (pid < 0) {
-        perror("unable to fork vncviewer");
-        return;
-    } else if (pid > 0)
+    if (pid)
         return;
 
     postfork();
@@ -2009,10 +2006,7 @@ static void autoconnect_console(libxl_ctx *ctx_ignored,
     console_child_report();
 
     pid_t pid = xl_fork(child_console);
-    if (pid < 0) {
-        perror("unable to fork xenconsole");
-        return;
-    } else if (pid > 0)
+    if (pid)
         return;
 
     postfork();
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.