$OpenBSD: patch-kdesu_process_cpp,v 1.8 2006/06/03 12:47:30 espie Exp $
--- kdesu/process.cpp.orig	Mon May 22 20:14:18 2006
+++ kdesu/process.cpp	Sun May 28 13:22:11 2006
@@ -429,8 +429,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) 
