void eTuxtxtApp::recvEvent(const int &evt) { uiRunning = false; eRCInput::getInstance()->unlock(); eDBoxLCD::getInstance()->unlock(); eDBoxLCD::getInstance()->update(); fbClass::getInstance()->unlock(); /* emit */appClosed(); }
int eTuxtxtApp::startUi() { if (fbClass::getInstance()->lock() >= 0) { eDBoxLCD::getInstance()->lock(); eRCInput::getInstance()->lock(); pthread_mutex_lock( &cacheChangeLock ); uiRunning = true; pthread_mutex_unlock( &cacheChangeLock ); run(); } else { /* emit */appClosed(); } return 0; }
void eConsoleAppContainer::readyRead(int what) { bool hungup = what & eSocketNotifier::Hungup; if (what & (eSocketNotifier::Priority|eSocketNotifier::Read)) { // eDebug("what = %d"); char buf[2049]; int rd; while((rd = read(fd[0], buf, 2048)) > 0) { buf[rd]=0; /*emit*/ dataAvail(buf); stdoutAvail(buf); if ( filefd[1] > 0 ) ::write(filefd[1], buf, rd); if (!hungup) break; } } readyErrRead(eSocketNotifier::Priority|eSocketNotifier::Read); /* be sure to flush all data which might be already written */ if (hungup) { eDebug("child has terminated"); closePipes(); int childstatus; int retval = killstate; /* * We have to call 'wait' on the child process, in order to avoid zombies. * Also, this gives us the chance to provide better exit status info to appClosed. */ if (::waitpid(pid, &childstatus, 0) > 0) { if (WIFEXITED(childstatus)) { retval = WEXITSTATUS(childstatus); } } /*emit*/ appClosed(retval); } }
void eNFSSetup::mountTimeout() { appClosed(0); }