Explorar o código

Revert "[lua] add checks for asynchronous process close()"

This reverts commit 458719ebd1983b08ed2437f394a426f2d13ebb48.
Justin Donaldson %!s(int64=6) %!d(string=hai) anos
pai
achega
7775809ac4
Modificáronse 2 ficheiros con 8 adicións e 27 borrados
  1. 6 25
      std/lua/_std/sys/io/Process.hx
  2. 2 2
      std/lua/lib/luv/Stream.hx

+ 6 - 25
std/lua/_std/sys/io/Process.hx

@@ -89,7 +89,8 @@ class Process {
 
 
 		var opt = { args: setArgs(cmd, args), stdio : stdio };
 		var opt = { args: setArgs(cmd, args), stdio : stdio };
 
 
-		var p = lua.lib.luv.Process.spawn( _shell, opt, function(code : Int, signal : Signal){
+		var p : lua.lib.luv.Process.LuvSpawn;
+		p = lua.lib.luv.Process.spawn( _shell, opt, function(code : Int, signal : Signal){
 			_code = code;
 			_code = code;
 		});
 		});
 
 
@@ -104,9 +105,9 @@ class Process {
 	}
 	}
 
 
 	public function close() : Void {
 	public function close() : Void {
-		stderr.close();
-		stdin.close();
 		stdout.close();
 		stdout.close();
+		stdin.close();
+		stderr.close();
 		_handle.close();
 		_handle.close();
 	}
 	}
 
 
@@ -192,17 +193,7 @@ private class ProcessInput extends haxe.io.Input {
 	}
 	}
 
 
 	override public function close() {
 	override public function close() {
-		if (b.is_closing()){
-			return;
-		} else if (b.is_active()) {
-			b.shutdown((type, status)-> {
-				if (status != 0){
-					throw "Invalid shutdown";
-				} else {
-					b.close();
-				}
-			});
-		}
+		b.close();
 	}
 	}
 }
 }
 
 
@@ -219,17 +210,7 @@ private class ProcessOutput extends haxe.io.Output {
 	}
 	}
 
 
 	override public function close(){
 	override public function close(){
-		if (b.is_closing()){
-			return;
-		} else {
-			b.shutdown((type, status)-> {
-				if (status != 0){
-					throw "Invalid shutdown";
-				} else {
-					b.close();
-				}
-			});
-		}
+		b.close();
 	}
 	}
 }
 }
 
 

+ 2 - 2
std/lua/lib/luv/Stream.hx

@@ -20,12 +20,12 @@
  * DEALINGS IN THE SOFTWARE.
  * DEALINGS IN THE SOFTWARE.
  */
  */
 
 
-package lua.lib.luv;
+package lua.lib.luv; 
 import lua.lib.luv.net.Tcp;
 import lua.lib.luv.net.Tcp;
 
 
 @:luaRequire("luv")
 @:luaRequire("luv")
 extern class Stream extends Handle {
 extern class Stream extends Handle {
-  function shutdown(?cb : Dynamic->Int->Void) : Int;
+  function shutdown(?cb : Void->Void) : Int;
   function listen(backlog : Int, cb : String->String->Void) : Int;
   function listen(backlog : Int, cb : String->String->Void) : Int;
   function accept(client_stream : Stream) : Int;
   function accept(client_stream : Stream) : Int;
   function read_start(cb : String->String->Void) : Int;
   function read_start(cb : String->String->Void) : Int;