further debugging / logging / work on tester, trynig to get to the bottom of nondeterministic rdi generation

This commit is contained in:
Ryan Fleury
2024-10-15 17:41:18 -07:00
parent 65b5176468
commit 4671458e8e
7 changed files with 177 additions and 22 deletions
+10
View File
@@ -193,6 +193,8 @@ os_cmd_line_launch(String8 string)
OS_Handle stdout_handle = {0};
if(stdout_path.size != 0)
{
OS_Handle file = os_file_open(OS_AccessFlag_Write|OS_AccessFlag_Read, stdout_path);
os_file_close(file);
stdout_handle = os_file_open(OS_AccessFlag_Write|OS_AccessFlag_Append|OS_AccessFlag_ShareRead|OS_AccessFlag_ShareWrite|OS_AccessFlag_Inherited, stdout_path);
}
@@ -210,6 +212,14 @@ os_cmd_line_launch(String8 string)
params.inherit_env = 1;
params.stdout_file = stdout_handle;
handle = os_process_launch(&params);
// rjf: close stdout handle
{
if(stdout_path.size != 0)
{
os_file_close(stdout_handle);
}
}
}
scratch_end(scratch);
return handle;
+5 -5
View File
@@ -294,13 +294,13 @@ os_file_open(OS_AccessFlags flags, String8 path)
DWORD share_mode = 0;
DWORD creation_disposition = OPEN_EXISTING;
SECURITY_ATTRIBUTES security_attributes = {sizeof(security_attributes), 0, 0};
if(flags & OS_AccessFlag_Read) {access_flags |= GENERIC_READ;}
if(flags & OS_AccessFlag_Write) {access_flags |= GENERIC_WRITE;}
if(flags & OS_AccessFlag_Execute) {access_flags |= GENERIC_EXECUTE;}
if(flags & OS_AccessFlag_Read) {access_flags |= GENERIC_READ;}
if(flags & OS_AccessFlag_Write) {access_flags |= GENERIC_WRITE;}
if(flags & OS_AccessFlag_Execute) {access_flags |= GENERIC_EXECUTE;}
if(flags & OS_AccessFlag_ShareRead) {share_mode |= FILE_SHARE_READ;}
if(flags & OS_AccessFlag_ShareWrite) {share_mode |= FILE_SHARE_WRITE|FILE_SHARE_DELETE;}
if(flags & OS_AccessFlag_Write) {creation_disposition = CREATE_ALWAYS;}
if(flags & OS_AccessFlag_Append) {creation_disposition = OPEN_ALWAYS; access_flags |= FILE_APPEND_DATA; }
if(flags & OS_AccessFlag_Write) {creation_disposition = CREATE_ALWAYS;}
if(flags & OS_AccessFlag_Append) {creation_disposition = OPEN_ALWAYS; access_flags |= FILE_APPEND_DATA; }
if(flags & OS_AccessFlag_Inherited)
{
security_attributes.bInheritHandle = 1;