diff --git a/src/nohup/nohup.c.v b/src/nohup/nohup.c.v index 9f74a30c..4cb10ef6 100644 --- a/src/nohup/nohup.c.v +++ b/src/nohup/nohup.c.v @@ -1,3 +1,10 @@ #include "unistd.h" fn C.dup2(oldfd int, newfd int) int + +// dup2_fds is the wrapper the pure .v file calls. V no longer permits a C call +// directly in a .v file, so the declaration and the call have to sit on opposite +// sides of the .c.v boundary. +pub fn dup2_fds(oldfd int, newfd int) int { + return C.dup2(oldfd, newfd) +} diff --git a/src/nohup/nohup.v b/src/nohup/nohup.v index 662a0ad6..b3297e3b 100644 --- a/src/nohup/nohup.v +++ b/src/nohup/nohup.v @@ -70,7 +70,7 @@ fn main() { open_nohup_out(mut f, false) or { common.exit_with_error_message(tool_name, err.msg()) } } else { // couldn't find a v equilavent of this - C.dup2(os.stdout().fd, os.stderr().fd) + dup2_fds(os.stdout().fd, os.stderr().fd) } }