Compare commits
2 Commits
3a51807fa6
...
4dcee8f828
Author | SHA1 | Date | |
---|---|---|---|
4dcee8f828 | |||
84c1871d30 |
@ -88,7 +88,7 @@ Result<int> luna_main(int argc, char** argv)
|
|||||||
auto cmd = TRY(input_file->read_line());
|
auto cmd = TRY(input_file->read_line());
|
||||||
if (cmd.is_empty())
|
if (cmd.is_empty())
|
||||||
{
|
{
|
||||||
puts("exit");
|
if (interactive) puts("exit");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,11 +184,14 @@ extern "C"
|
|||||||
{
|
{
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
{
|
{
|
||||||
// FIXME: Check if there is a shell available in the system.
|
struct stat st;
|
||||||
errno = ENOTSUP;
|
if (stat("/bin/sh", &st) < 0) return 0;
|
||||||
return -1;
|
return S_ISREG(st.st_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: During the execution of system(), SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored, in
|
||||||
|
// the process that calls system().
|
||||||
|
|
||||||
pid_t child = fork();
|
pid_t child = fork();
|
||||||
if (child == 0)
|
if (child == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user