Terminal & Expander: Replace exit() with _exit() in fork+exec failure path.

This is necessary to avoid destructors being called in the child,
potentially messing up parent state.
This commit is contained in:
Augustin Cavalier
2026-02-27 10:17:40 -05:00
parent 1380d03a42
commit 66d85d702b
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -258,8 +258,8 @@ ExpanderThread::PipeCommand(int argc, const char** argv, int& in, int& out,
// "load" command.
execv(argv[0], (char *const *)argv);
// shouldn't return
return -1;
// shouldn't get here
_exit(-1);
}
// parent
+5 -5
View File
@@ -432,7 +432,7 @@ Shell::_Spawn(int row, int col, const ShellParameters& parameters)
snprintf(handshake.msg, sizeof(handshake.msg),
"could not set session leader.");
send_handshake_message(terminalThread, handshake);
exit(1);
_exit(1);
}
/* open slave pty */
@@ -442,7 +442,7 @@ Shell::_Spawn(int row, int col, const ShellParameters& parameters)
snprintf(handshake.msg, sizeof(handshake.msg),
"can't open tty (%s).", ttyName);
send_handshake_message(terminalThread, handshake);
exit(1);
_exit(1);
}
/* set signal default */
@@ -487,7 +487,7 @@ Shell::_Spawn(int row, int col, const ShellParameters& parameters)
snprintf(handshake.msg, sizeof(handshake.msg),
"failed set terminal interface (TERMIOS).");
send_handshake_message(terminalThread, handshake);
exit(1);
_exit(1);
}
/*
@@ -503,7 +503,7 @@ Shell::_Spawn(int row, int col, const ShellParameters& parameters)
snprintf(handshake.msg, sizeof(handshake.msg),
"mismatch handshake.");
send_handshake_message(terminalThread, handshake);
exit(1);
_exit(1);
}
struct winsize ws = { handshake.row, handshake.col };
@@ -553,7 +553,7 @@ Shell::_Spawn(int row, int col, const ShellParameters& parameters)
"-l", NULL);
}
exit(1);
_exit(1);
}
/*