mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-15 23:09:05 +00:00
Terminal: Handle fork error by whining about it
This commit is contained in:
parent
bc9013f706
commit
2814b5a918
Notes:
sideshowbarker
2024-07-19 06:08:50 +09:00
Author: https://github.com/alimpfard
Commit: 2814b5a918
Pull-request: https://github.com/SerenityOS/serenity/pull/2372
Issue: https://github.com/SerenityOS/serenity/issues/2370
Reviewed-by: https://github.com/bugaevc
1 changed files with 6 additions and 0 deletions
|
@ -57,6 +57,12 @@
|
||||||
static void run_command(int ptm_fd, String command)
|
static void run_command(int ptm_fd, String command)
|
||||||
{
|
{
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
|
if (pid < 0) {
|
||||||
|
perror("fork");
|
||||||
|
dbg() << "run_command: could not fork to run '" << command << "'";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
const char* tty_name = ptsname(ptm_fd);
|
const char* tty_name = ptsname(ptm_fd);
|
||||||
if (!tty_name) {
|
if (!tty_name) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue