1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

Terminal: Handle fork error by whining about it

This commit is contained in:
AnotherTest 2020-05-25 17:04:57 +04:30 committed by Andreas Kling
parent bc9013f706
commit 2814b5a918

View file

@ -57,6 +57,12 @@
static void run_command(int ptm_fd, String command)
{
pid_t pid = fork();
if (pid < 0) {
perror("fork");
dbg() << "run_command: could not fork to run '" << command << "'";
return;
}
if (pid == 0) {
const char* tty_name = ptsname(ptm_fd);
if (!tty_name) {