Aurel Bílý vor 6 Jahren
Ursprung
Commit
b7591e736f
2 geänderte Dateien mit 7 neuen und 1 gelöschten Zeilen
  1. 1 1
      libs/uv/uv_stubs.c
  2. 6 0
      src/macro/eval/evalStdLib.ml

+ 1 - 1
libs/uv/uv_stubs.c

@@ -1146,7 +1146,7 @@ CAMLprim value w_spawn(value loop, value cb, value file, value args, value env,
 }
 BC_WRAP10(w_spawn);
 
-CAMLprim value w_process_kill(value handle, value signum) {
+CAMLprim value w_process_kill(value handle, value signum, value cb) {
 	CAMLparam2(handle, signum);
 	UV_ERROR_CHECK(uv_process_kill(Process_val(handle), Int_val(signum)));
 	UV_SUCCESS_UNIT;

+ 6 - 0
src/macro/eval/evalStdLib.ml

@@ -3846,6 +3846,11 @@ module StdUv = struct
 			let this = this vthis in
 			vint (Uv.process_get_pid this)
 		)
+		let close = vifun1 (fun vthis cb ->
+			let this = this vthis in
+			wrap_sync (Uv.close this (wrap_cb_unit cb));
+			vnull
+		)
 		let ref_ = wrap_ref this
 		let unref = wrap_unref this
 	end
@@ -4601,6 +4606,7 @@ let init_standard_library builtins =
 	init_fields builtins (["eval";"uv"],"Process") [] [
 		"kill",StdUv.Process.kill;
 		"getPid",StdUv.Process.getPid;
+		"close",StdUv.Process.close;
 		"ref",StdUv.Process.ref_;
 		"unref",StdUv.Process.unref;
 	];