From 19a5f25b80f44e5440a444df8af443d0081e46bf Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Wed, 10 Feb 2021 09:18:50 +0000 Subject: [PATCH] Mark slave_exec() as "noreturn" and convert xassert(false) to BUG(...) --- slave.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/slave.c b/slave.c index 29ad92f5..432e21ff 100644 --- a/slave.c +++ b/slave.c @@ -18,6 +18,7 @@ #include "log.h" #include "debug.h" +#include "macros.h" #include "terminal.h" #include "tokenize.h" #include "xmalloc.h" @@ -143,7 +144,7 @@ emit_notifications(int fd, const user_notifications_t *notifications) emit_notifications_of_kind(fd, notifications, USER_NOTIFICATION_DEPRECATED); } -static void +static noreturn void slave_exec(int ptmx, char *argv[], int err_fd, bool login_shell, const user_notifications_t *notifications) { @@ -316,7 +317,7 @@ slave_spawn(int ptmx, int argc, const char *cwd, char *const *argv, setenv("SHELL", shell_argv[0], 1); slave_exec(ptmx, shell_argv, fork_pipe[1], login_shell, notifications); - xassert(false); + BUG("Unexpected return from slave_exec()"); break; default: {