diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs index 520e7190ce8..6bc35ea171c 100644 --- a/src/compiletest/procsrv.rs +++ b/src/compiletest/procsrv.rs @@ -17,6 +17,7 @@ import std::comm::port; import std::comm::send; import std::comm::recv; +import std::ctypes::{pid_t, fd_t}; export handle; export mk; @@ -33,7 +34,8 @@ tag request { exec([u8], [u8], [[u8]], chan); stop; } -type response = {pid: int, infd: int, outfd: int, errfd: int}; +type response = {pid: pid_t, infd: fd_t, + outfd: fd_t, errfd: fd_t}; fn mk() -> handle { let setupport = port(); @@ -71,7 +73,7 @@ fn run(handle: handle, lib_path: str, prog: str, args: [str], ret {status: status, out: output, err: errput}; } -fn writeclose(fd: int, s: option::t) { +fn writeclose(fd: fd_t, s: option::t) { if option::is_some(s) { let writer = io::new_writer(io::fd_buf_writer(fd, option::none)); writer.write_str(option::get(s)); @@ -80,7 +82,7 @@ fn writeclose(fd: int, s: option::t) { os::close(fd); } -fn readclose(fd: int) -> str { +fn readclose(fd: fd_t) -> str { // Copied from run::program_output let file = os::fd_FILE(fd); let reader = io::new_reader(io::FILE_buf_reader(file, option::none)); @@ -137,7 +139,7 @@ fn worker(p: port) { os::close(pipe_in.in); os::close(pipe_out.out); os::close(pipe_err.out); - if pid == -1 { + if pid == -1i32 { os::close(pipe_in.out); os::close(pipe_out.in); os::close(pipe_err.in); diff --git a/src/lib/generic_os.rs b/src/lib/generic_os.rs index 9ce889761de..db5d4b28b67 100644 --- a/src/lib/generic_os.rs +++ b/src/lib/generic_os.rs @@ -41,16 +41,14 @@ fn getenv(n: str) -> option::t unsafe { #[cfg(target_os = "macos")] fn setenv(n: str, v: str) { // FIXME (868) - let _: () = - str::as_buf(n, - // FIXME (868) - {|nbuf| - let _: () = - str::as_buf(v, - {|vbuf| - os::libc::setenv(nbuf, vbuf, 1i32); - }); - }); + str::as_buf( + n, + // FIXME (868) + {|nbuf| + str::as_buf( + v, + {|vbuf| + os::libc::setenv(nbuf, vbuf, 1i32)})}); } #[cfg(target_os = "win32")] diff --git a/src/lib/run_program.rs b/src/lib/run_program.rs index ea24bc6dee8..a553f504001 100644 --- a/src/lib/run_program.rs +++ b/src/lib/run_program.rs @@ -15,8 +15,8 @@ #[abi = "cdecl"] native mod rustrt { - fn rust_run_program(argv: *sbuf, in_fd: fd_t, out_fd: fd_t, err_fd: fd_t) -> - pid_t; + fn rust_run_program(argv: *sbuf, in_fd: fd_t, + out_fd: fd_t, err_fd: fd_t) -> pid_t; } /* Section: Types */ @@ -115,7 +115,8 @@ fn arg_vec(prog: str, args: [@str]) -> [sbuf] { The process id of the spawned process */ -fn spawn_process(prog: str, args: [str], in_fd: fd_t, out_fd: fd_t, err_fd: fd_t) +fn spawn_process(prog: str, args: [str], in_fd: fd_t, + out_fd: fd_t, err_fd: fd_t) -> pid_t unsafe { // Note: we have to hold on to these vector references while we hold a // pointer to their buffers