aboutsummaryrefslogtreecommitdiff
path: root/slave.c
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2021-02-10 09:18:50 +0000
committerCraig Barnes <craigbarnes@protonmail.com>2021-02-10 09:18:50 +0000
commit19a5f25b80f44e5440a444df8af443d0081e46bf (patch)
tree2a535cac64f83e90344aa99f7501c60ba820c256 /slave.c
parentConvert all but 2 remaining uses of xassert(false) to BUG("...") (diff)
Mark slave_exec() as "noreturn" and convert xassert(false) to BUG(...)
Diffstat (limited to 'slave.c')
-rw-r--r--slave.c5
1 files 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: {