tools/libxl: Drop dead code following calls to libxl__exec()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 19 Nov 2015 12:43:52 +0000 (12:43 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 24 Nov 2015 16:16:34 +0000 (16:16 +0000)
libxl__exec() doesn't ever return.  Inform the compiler of this, and
remove all dead code.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl_aoutils.c
tools/libxl/libxl_bootloader.c
tools/libxl/libxl_internal.h

index 854e957c086866d493d95aa3a4d6942c8552c0bb..6ad9e13ffc1810377e670471c4dc50efbc1e9438 100644 (file)
@@ -1983,7 +1983,6 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
     }
 
     libxl__exec(gc, autopass_fd, -1, -1, args[0], args, NULL);
-    abort();
 
  x_fail:
     GC_FREE;
index d5fbc4d862264325b2142e106a31be703be5a032..9e493cd487b77399c2bc915959f98e7773dd9d18 100644 (file)
@@ -603,8 +603,6 @@ int libxl__async_exec_start(libxl__async_exec_state *aes)
         /* child */
         libxl__exec(gc, aes->stdfds[0], aes->stdfds[1],
                     aes->stdfds[2], args[0], args, aes->env);
-        /* notreached */
-        abort();
     }
 
     return 0;
index 95dde986f2cb58b8dff418fb8ff23396c703f19a..9caf212ab01262b2ad6e4a6bd1c4e921626c8e69 100644 (file)
@@ -556,7 +556,6 @@ static void bootloader_gotptys(libxl__egc *egc, libxl__openpty_state *op)
         r = login_tty(libxl__carefd_fd(bl->ptys[0].slave));
         if (r) { LOGE(ERROR, "login_tty failed"); exit(-1); }
         libxl__exec(gc, -1, -1, -1, bl->args[0], (char **) bl->args, env);
-        exit(-1);
     }
 
     /* parent */
index 590870a2f71659903c919308b37c4a125be86f28..58d07cd4f73a07c051a3a7ee4cbdc51ed9a4bec6 100644 (file)
@@ -1578,7 +1578,7 @@ _hidden int libxl__xenstore_child_wait_deprecated(libxl__gc *gc,
  */
 _hidden  void libxl__exec(libxl__gc *gc, int stdinfd, int stdoutfd,
                           int stderrfd, const char *arg0, char *const args[],
-                          char *const env[]);
+                          char *const env[]) __attribute__((noreturn));
 
 /* from xl_create */