xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/libxl: Drop dead code following calls to libxl__exec()
@ 2015-11-19 12:43 Andrew Cooper
  2015-11-24 16:52 ` Ian Campbell
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cooper @ 2015-11-19 12:43 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Ian Jackson, Ian Campbell, Wei Liu

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>
---
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl.c            | 1 -
 tools/libxl/libxl_aoutils.c    | 2 --
 tools/libxl/libxl_bootloader.c | 1 -
 tools/libxl/libxl_internal.h   | 2 +-
 4 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 854e957..6ad9e13 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -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;
diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c
index d5fbc4d..9e493cd 100644
--- a/tools/libxl/libxl_aoutils.c
+++ b/tools/libxl/libxl_aoutils.c
@@ -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;
diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
index 95dde98..9caf212 100644
--- a/tools/libxl/libxl_bootloader.c
+++ b/tools/libxl/libxl_bootloader.c
@@ -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 */
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 590870a..58d07cd 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -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 */
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tools/libxl: Drop dead code following calls to libxl__exec()
  2015-11-19 12:43 [PATCH] tools/libxl: Drop dead code following calls to libxl__exec() Andrew Cooper
@ 2015-11-24 16:52 ` Ian Campbell
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2015-11-24 16:52 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel; +Cc: Wei Liu, Ian Jackson

On Thu, 2015-11-19 at 12:43 +0000, Andrew Cooper wrote:
> 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 + applied, thanks.

> ---
> CC: Ian Campbell <Ian.Campbell@citrix.com>
> CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> ---
>  tools/libxl/libxl.c            | 1 -
>  tools/libxl/libxl_aoutils.c    | 2 --
>  tools/libxl/libxl_bootloader.c | 1 -
>  tools/libxl/libxl_internal.h   | 2 +-
>  4 files changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 854e957..6ad9e13 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -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;
> diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c
> index d5fbc4d..9e493cd 100644
> --- a/tools/libxl/libxl_aoutils.c
> +++ b/tools/libxl/libxl_aoutils.c
> @@ -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;
> diff --git a/tools/libxl/libxl_bootloader.c
> b/tools/libxl/libxl_bootloader.c
> index 95dde98..9caf212 100644
> --- a/tools/libxl/libxl_bootloader.c
> +++ b/tools/libxl/libxl_bootloader.c
> @@ -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 */
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index 590870a..58d07cd 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -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 */
>  
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-24 16:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-19 12:43 [PATCH] tools/libxl: Drop dead code following calls to libxl__exec() Andrew Cooper
2015-11-24 16:52 ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).