From c8b810f149c2ed1815ae59b5275d435152ab52ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 11 Oct 2014 17:45:18 +0200 Subject: [PATCH] Fix tdesu process handling --- tdesu/process.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tdesu/process.cpp b/tdesu/process.cpp index 28e3bb110..0fded3184 100644 --- a/tdesu/process.cpp +++ b/tdesu/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)