aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-05-19 11:57:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-05-19 11:57:45 +0200
commitdae0fd31fab4bb3a32ffecf7b56c101e98d4d343 (patch)
treeb3755f1b46e1b261831c2c62e423b0dc0849f079
parent70062c72cc7f0acef94a333247cc07df74cd3626 (diff)
Instrument MSYS2 workaround code for further analysis
-rw-r--r--libbutl/process.cxx8
-rw-r--r--libbutl/process.hxx10
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<bool> msys; // Absent if we don't know.
+ optional<bool>& 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<bool> 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<bool> msys_;
+#endif
};
// Higher-level process running interface that aims to make executing a