diff options
author | François Andriot <francois.andriot@free.fr> | 2014-10-11 17:45:18 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-12-23 02:22:55 +0100 |
commit | 0fbdee1c7ca5681c43dd2be9a7025bc7d36031ec (patch) | |
tree | 05a9ae5abe8aa128a904ae385b1ac48cc1e9cb25 /kdesu/process.cpp | |
parent | 24d1217f49309d104c9ae3877318e4c3b6a37cff (diff) | |
download | tdelibs-0fbdee1c7ca5681c43dd2be9a7025bc7d36031ec.tar.gz tdelibs-0fbdee1c7ca5681c43dd2be9a7025bc7d36031ec.zip |
Fix tdesu process handling
(cherry picked from commit c8b810f149c2ed1815ae59b5275d435152ab52ad)
Diffstat (limited to 'kdesu/process.cpp')
-rw-r--r-- | kdesu/process.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kdesu/process.cpp b/kdesu/process.cpp index 744d2672f..edd80c67d 100644 --- a/kdesu/process.cpp +++ b/kdesu/process.cpp @@ -492,8 +492,13 @@ int PtyProcess::waitForChild() while (1) { - FD_SET(m_Fd, &fds); - int ret = select(m_Fd+1, &fds, 0L, 0L, 0L); + int ret = 0; + + if (m_Fd != -1) + { + FD_SET(m_Fd, &fds); + ret = select(m_Fd+1, &fds, 0L, 0L, 0L); + } if (ret == -1) { if (errno != EINTR) |