Diffstat (limited to 'noncore/applets/keyhelper/keyhelperapplet/anylnk') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/applets/keyhelper/keyhelperapplet/anylnk/ProcessInvoker.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/applets/keyhelper/keyhelperapplet/anylnk/ProcessInvoker.cpp b/noncore/applets/keyhelper/keyhelperapplet/anylnk/ProcessInvoker.cpp index 09605bd..ff06551 100644 --- a/noncore/applets/keyhelper/keyhelperapplet/anylnk/ProcessInvoker.cpp +++ b/noncore/applets/keyhelper/keyhelperapplet/anylnk/ProcessInvoker.cpp @@ -1,50 +1,54 @@ #include "ProcessInvoker.h" +#ifndef PIPE_BUF // uClibc or similar +#include <linux/limits.h> +#endif + static ProcessInvoker* g_this; /* ------------------------------------------------------------------------ */ /* static functions */ /* ------------------------------------------------------------------------ */ static Sigfunc* setSignalHandler(int signo, Sigfunc* handler) { struct sigaction act,oact; act.sa_handler = handler; ::sigemptyset(&act.sa_mask); act.sa_flags = 0; #ifdef SA_RESTART act.sa_flags |= SA_RESTART; #endif if(::sigaction(signo, &act, &oact) < 0){ return(NULL); } return(oact.sa_handler); } static void childHandler(int /*signo*/) { pid_t pid; int status; while((pid = ::waitpid(-1, &status, WNOHANG)) > 0){ if(pid == g_this->m_child){ g_this->notifyFinish(status); } } } /* ------------------------------------------------------------------------ */ /* ProcessInvoker Class : parent process */ /* ------------------------------------------------------------------------ */ ProcessInvoker::ProcessInvoker() { g_this = this; m_isRunning = false; m_child = 0; m_defChildHandler = SIG_DFL; m_pTimer = new QTimer(this); m_stdfd[0] = m_stdfd[1] = -1; m_errfd[0] = m_errfd[1] = -1; connect(m_pTimer, SIGNAL(timeout()), this, SLOT(readOutputs())); } |