From f95b70abd20b8f86de2e7263ea6ac741ca7bce5a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Wed, 21 May 1997 17:39:28 -0700
Subject: [PATCH] Bugfix

Rev: lib/modules/Process.pmod:1.8
---
 lib/modules/Process.pmod | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/lib/modules/Process.pmod b/lib/modules/Process.pmod
index 7b7e61294b..f85ece94a3 100644
--- a/lib/modules/Process.pmod
+++ b/lib/modules/Process.pmod
@@ -32,20 +32,14 @@ varargs int spawn(string s,object stdin,object stdout,object stderr)
   {
     return pid;
   }else{
-    if(stdin) {
-      stdin->dup2(File("stdin"));
-      stdin->close();
-    }
-
-    if(stdout) {
-      stdout->dup2(File("stdout"));
-      stdout->close();
-    }
-
-    if(stderr) {
-      stderr->dup2(File("stderr"));
-      stderr->close();
-    }
+    if(stdin ) stdin ->dup2(File("stdin"));
+    if(stdout) stdout->dup2(File("stdout"));
+    if(stderr) stderr->dup2(File("stderr"));
+
+    if(stdin ) destruct(stdin);
+    if(stdout) destruct(stdout);
+    if(stderr) destruct(stderr);
+
     ::close();
     exec("/bin/sh","-c",s);
     exit(69);
-- 
GitLab