From dae0fd31fab4bb3a32ffecf7b56c101e98d4d343 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 19 May 2017 11:57:45 +0200 Subject: Instrument MSYS2 workaround code for further analysis --- libbutl/process.cxx | 8 ++++++-- libbutl/process.hxx | 10 ++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libbutl/process.cxx b/libbutl/process.cxx index 53dd282..49e11bb 100644 --- a/libbutl/process.cxx +++ b/libbutl/process.cxx @@ -1170,7 +1170,8 @@ namespace butl // process loaded the msys-2.0.dll. With this improvement we can then // wait longer and try harder. // - optional msys; // Absent if we don't know. + optional& msys = msys_; // Absent if we don't know. + msys = nullopt; for (size_t ret (0); ret != (msys ? 40 : 20); ++ret) { @@ -1270,6 +1271,7 @@ namespace butl { exit = process_exit (); exit->status = es; + exit->msys_ = msys_; } else { @@ -1306,6 +1308,7 @@ namespace butl exit = process_exit (); exit->status = es; + exit->msys_ = msys_; } return true; @@ -1392,7 +1395,8 @@ namespace butl switch (status) { case STATUS_ACCESS_VIOLATION: return "access violation"; - case STATUS_DLL_INIT_FAILED: return "DLL initialization failed"; + case STATUS_DLL_INIT_FAILED: return "DLL initialization failed" + + string (msys_ ? (*msys_ ? " (MSYS)" : " (not MSYS)") : " (unknown)"); case STATUS_INTEGER_DIVIDE_BY_ZERO: return "integer divided by zero"; // VC-compiled program that calls abort() terminates with this error code diff --git a/libbutl/process.hxx b/libbutl/process.hxx index 1f82af0..11b320c 100644 --- a/libbutl/process.hxx +++ b/libbutl/process.hxx @@ -175,6 +175,12 @@ namespace butl // std::string description () const; + + // @@ TMP + // +#ifdef _WIN32 + optional msys_; +#endif }; class LIBBUTL_EXPORT process @@ -380,6 +386,10 @@ namespace butl auto_fd out_fd; // Write to it to send to stdin. auto_fd in_ofd; // Read from it to receive from stdout. auto_fd in_efd; // Read from it to receive from stderr. + +#ifdef _WIN32 + optional msys_; +#endif }; // Higher-level process running interface that aims to make executing a -- cgit v1.1