Browse Source

Minor fix to terminal.cc.

merge-requests/365/head
eidheim 10 years ago
parent
commit
c841c7ff11
  1. 2
      src/terminal.cc

2
src/terminal.cc

@ -20,10 +20,10 @@ std::unordered_map<pid_t, int> async_execute_status;
//TODO: Windows... //TODO: Windows...
//Coppied partially from http://www.linuxprogrammingblog.com/code-examples/sigaction //Coppied partially from http://www.linuxprogrammingblog.com/code-examples/sigaction
void signal_execl_exit(int sig, siginfo_t *siginfo, void *context) { void signal_execl_exit(int sig, siginfo_t *siginfo, void *context) {
async_and_sync_execute_mutex.lock();
int status; int status;
while (waitpid(siginfo->si_pid, &status, WNOHANG) > 0) {} while (waitpid(siginfo->si_pid, &status, WNOHANG) > 0) {}
async_and_sync_execute_mutex.lock();
if(async_execute_descriptors.find(siginfo->si_pid)!=async_execute_descriptors.end()) { if(async_execute_descriptors.find(siginfo->si_pid)!=async_execute_descriptors.end()) {
async_execute_status[siginfo->si_pid]=status; async_execute_status[siginfo->si_pid]=status;
close(async_execute_descriptors.at(siginfo->si_pid).first); close(async_execute_descriptors.at(siginfo->si_pid).first);

Loading…
Cancel
Save