$OpenBSD: patch-kdecore_kprocess_cpp,v 1.2 2003/01/27 19:16:47 espie Exp $
--- kdecore/kprocess.cpp.orig	Fri Jan  3 05:56:52 2003
+++ kdecore/kprocess.cpp	Mon Jan 13 14:18:02 2003
@@ -293,7 +293,7 @@ bool KProcess::start(RunMode runmode, Co
   int fd[2];
   if (0 > pipe(fd))
   {
-     fd[0] = fd[1] = 0; // Pipe failed.. continue
+     fd[0] = fd[1] = -1; // Pipe failed.. continue
   }
 
   runs = true;
@@ -305,7 +305,7 @@ bool KProcess::start(RunMode runmode, Co
   pid_ = fork();
 
   if (0 == pid_) {
-        if (fd[0])
+        if (fd[0] >= 0)
            close(fd[0]);
         if (!runPrivileged())
         {
@@ -335,11 +335,11 @@ bool KProcess::start(RunMode runmode, Co
 
         // We set the close on exec flag.
         // Closing of fd[1] indicates that the execvp succeeded!
-        if (fd[1])
+        if (fd[1] >= 0)
           fcntl(fd[1], F_SETFD, FD_CLOEXEC);
         execvp(arglist[0], arglist);
         char resultByte = 1;
-        if (fd[1])
+        if (fd[1] >= 0)
           write(fd[1], &resultByte, 1);
         _exit(-1);
   } else if (-1 == pid_) {
@@ -349,7 +349,7 @@ bool KProcess::start(RunMode runmode, Co
         free(arglist);
         return false;
   } else {
-        if (fd[1])
+        if (fd[1] >= 0)
           close(fd[1]);
         // the parent continues here
 
@@ -357,7 +357,7 @@ bool KProcess::start(RunMode runmode, Co
         input_data = 0;
 
         // Check whether client could be started.
-        if (fd[0]) for(;;)
+        if (fd[0] >= 0) for(;;)
         {
            char resultByte;
            int n = ::read(fd[0], &resultByte, 1);
@@ -377,7 +377,7 @@ bool KProcess::start(RunMode runmode, Co
            }
            break; // success
         }
-        if (fd[0])
+        if (fd[0] >= 0)
            close(fd[0]);
 
         if (!commSetupDoneP())  // finish communication socket setup for the parent
