From 15507d112650477ad64a5c9b19b4e515124affec Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 18 Nov 2020 17:32:25 +0300 Subject: Fix set buildscript builtin crash on Windows --- libbuild2/script/run.cxx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'libbuild2') diff --git a/libbuild2/script/run.cxx b/libbuild2/script/run.cxx index 703cd11..ca4a935 100644 --- a/libbuild2/script/run.cxx +++ b/libbuild2/script/run.cxx @@ -844,6 +844,11 @@ namespace build2 set_builtin (environment& env, const strings& args, auto_fd in, +#ifndef _WIN32 + bool, +#else + bool pipe, +#endif const optional& dl, const command& deadline_cmd, const location& ll) @@ -889,7 +894,19 @@ namespace build2 // variable value will be incomplete, but we leave it to the caller // to handle that. // + // Note that on Windows we can only turn pipe file descriptors into + // the non-blocking mode. Thus, we have no choice but to read from + // descriptors of other types synchronously there. That implies that + // we can potentially block indefinitely reading a file and missing + // the deadline on Windows. Note though, that the user can always + // rewrite `set foo <<= 2) print_process (process_args ()); - set_builtin (env, c.arguments, move (ifd), + set_builtin (env, c.arguments, + move (ifd), !first, dl, dl_cmd != nullptr ? *dl_cmd : c, ll); -- cgit v1.1