summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2024-06-06 13:58:11 +0200
committerMitya Selivanov <automainint@guattari.tech>2024-06-06 13:58:11 +0200
commit93bd91f18b016990931cf879b2d9dd6e864f28ec (patch)
treef6de4e7f277749dfd7333afa2d2bdef8eda57c7b
parent23e0f7f446b9a27f6ac8ae3f646719324dfac781 (diff)
downloadkit-93bd91f18b016990931cf879b2d9dd6e864f28ec.zip
[build] debug
-rwxr-xr-xbuild.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/build.c b/build.c
index c8f94e8..838d3ec 100755
--- a/build.c
+++ b/build.c
@@ -562,11 +562,31 @@ i32 main(i32 argc, c8 **argv) {
system(fmt("\"." DLM "%s" DLM "test_interprocess\" clean", destination));
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ STARTUPINFO si = { .cb = sizeof(STARTUPINFO) };
+ PROCESS_INFORMATION pi = { 0 };
+#endif
+
if (OS == WINDOWS) {
- system(fmt("start "" \"." DLM "%s" DLM "test_interprocess\" reader", destination));
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ printf(" *** Starting reader\n"); fflush(stdout);
+ CreateProcessA(
+ NULL,
+ fmt("\"." DLM "%s" DLM "test_interprocess\" reader", destination),
+ NULL,
+ NULL,
+ 0,
+ 0,
+ NULL,
+ NULL,
+ &si,
+ &pi
+ );
+#endif
} else
system(fmt("\"." DLM "%s" DLM "test_interprocess\" reader &", destination));
+ printf(" *** Starting writer\n"); fflush(stdout);
code = system(fmt("\"." DLM "%s" DLM "test_interprocess\" writer", destination));
if (code == 0)
@@ -577,6 +597,14 @@ i32 main(i32 argc, c8 **argv) {
}
fflush(stdout);
+ printf(" *** Waiting for reader\n"); fflush(stdout);
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ WaitForSingleObject(pi.hProcess, INFINITE);
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ #endif
+
printf("\nAll done.\n");
return status;
}