Revert "[readline] try clone() if fork() does not work"

This reverts commit 86b999c464.
pull/1205/head
Tim Stack 8 months ago
parent 86b999c464
commit 79d813fb72

@ -29,7 +29,6 @@
#include "auto_pid.hh"
#include <sys/syscall.h>
#include <unistd.h>
#include "config.h"
@ -41,25 +40,10 @@ namespace pid {
bool in_child = false;
pid_t
fork()
{
auto retval = ::fork();
if (retval == -1 && errno == ENOSYS) {
#ifdef SYS_clone
log_error("fork() not implemented, trying clone...");
retval = syscall(SYS_clone, SIGCHLD, 0);
#endif
}
return retval;
}
Result<auto_pid<process_state::running>, std::string>
from_fork()
{
auto pid = lnav::pid::fork();
auto pid = ::fork();
if (pid == -1) {
return Err(

@ -167,10 +167,7 @@ namespace pid {
extern bool in_child;
pid_t fork();
Result<auto_pid<process_state::running>, std::string> from_fork();
} // namespace pid
} // namespace lnav

@ -118,7 +118,7 @@ grep_proc<LineType>::start()
throw error(errno);
}
if ((this->gp_child = lnav::pid::fork()) < 0) {
if ((this->gp_child = fork()) < 0) {
throw error(errno);
}

@ -1857,7 +1857,7 @@ com_pipe_to(exec_context& ec,
auto child_fds = for_child_res.unwrap();
pid_t child_pid = lnav::pid::fork();
pid_t child_pid = fork();
for (auto& child_fd : child_fds) {
child_fd.after_fork(child_pid);

@ -58,7 +58,6 @@
#include "base/ansi_scrubber.hh"
#include "base/auto_mem.hh"
#include "base/auto_pid.hh"
#include "base/fs_util.hh"
#include "base/itertools.hh"
#include "base/lnav_log.hh"
@ -794,7 +793,7 @@ readline_curses::start()
this->rc_pty[RCF_MASTER].close_on_exec();
this->rc_pty[RCF_SLAVE].close_on_exec();
if ((this->rc_child = lnav::pid::fork()) == -1) {
if ((this->rc_child = fork()) == -1) {
log_error("fork() failed -- %s", strerror(errno));
throw error(errno);
}

Loading…
Cancel
Save