diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-06-06 13:58:11 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-06-06 13:58:11 +0200 |
commit | 93bd91f18b016990931cf879b2d9dd6e864f28ec (patch) | |
tree | f6de4e7f277749dfd7333afa2d2bdef8eda57c7b | |
parent | 23e0f7f446b9a27f6ac8ae3f646719324dfac781 (diff) | |
download | kit-93bd91f18b016990931cf879b2d9dd6e864f28ec.zip |
[build] debug
-rwxr-xr-x | build.c | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -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; } |