Browse Source

fix attempt in php.io.Process.exitCode()

Franco Ponticelli 17 years ago
parent
commit
04af5cf2a9
1 changed files with 4 additions and 1 deletions
  1. 4 1
      std/php/io/Process.hx

+ 4 - 1
std/php/io/Process.hx

@@ -130,8 +130,11 @@ class Process {
 			php.Sys.sleep(0.01);
 			php.Sys.sleep(0.01);
 			status = untyped __call__('proc_get_status', p);
 			status = untyped __call__('proc_get_status', p);
 		}
 		}
+//		php.Lib.dump(status);
 		replaceStream(stderr);
 		replaceStream(stderr);
 		replaceStream(stdout);
 		replaceStream(stdout);
-		return untyped __call__('proc_close', p);
+		var cl = untyped __call__('proc_close', p);
+		return (status[untyped 'exitcode'] < 0) ? cl : status[untyped 'exitcode'];
+
 	}
 	}
 }
 }