mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
Shell: Build as part of Lagom as well
Bringing the Serenity Shell to your very own host system :^)
This commit is contained in:
committed by
Andreas Kling
parent
d2bdbc3e77
commit
639c1a1737
@@ -78,6 +78,12 @@ int main(int argc, char** argv)
|
||||
for (auto& job : jobs) {
|
||||
int wstatus = 0;
|
||||
auto child_pid = waitpid(job.value->pid(), &wstatus, WNOHANG);
|
||||
#ifndef __serenity__
|
||||
if (child_pid == 0) {
|
||||
// Linux: if child didn't "change state", but existed.
|
||||
child_pid = job.value->pid();
|
||||
}
|
||||
#endif
|
||||
if (child_pid == job.value->pid()) {
|
||||
if (WIFEXITED(wstatus)) {
|
||||
job.value->set_has_exit(WEXITSTATUS(wstatus));
|
||||
@@ -95,10 +101,18 @@ int main(int argc, char** argv)
|
||||
// Ignore SIGTSTP as the shell should not be suspended with ^Z.
|
||||
signal(SIGTSTP, [](auto) {});
|
||||
|
||||
#ifndef __serenity__
|
||||
sigset_t blocked;
|
||||
sigemptyset(&blocked);
|
||||
sigaddset(&blocked, SIGTTOU);
|
||||
pthread_sigmask(SIG_BLOCK, &blocked, NULL);
|
||||
#endif
|
||||
#ifdef __serenity__
|
||||
if (pledge("stdio rpath wpath cpath proc exec tty accept", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
editor = Line::Editor::construct(Line::Configuration { Line::Configuration::UnescapedSpaces });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user