extend os info struct with binary file path

This commit is contained in:
Nikita Smith
2026-06-02 12:09:57 -07:00
committed by Ryan Fleury
parent 5d8c568d82
commit 2643d14e06
5 changed files with 7 additions and 5 deletions
+1
View File
@@ -9,6 +9,7 @@ struct ProcessInfo
{ {
U32 pid; U32 pid;
B32 large_pages_allowed; B32 large_pages_allowed;
String8 binary_file_path;
String8 binary_path; String8 binary_path;
String8 initial_path; String8 initial_path;
String8 user_program_data_path; String8 user_program_data_path;
+1 -1
View File
@@ -797,7 +797,7 @@ di_async_tick(void)
params.path = get_process_info()->binary_path; params.path = get_process_info()->binary_path;
params.inherit_env = 1; params.inherit_env = 1;
params.consoleless = 1; params.consoleless = 1;
str8_list_push(scratch.arena, &params.cmd_line, os_get_process_info()->binary_path); str8_list_push(scratch.arena, &params.cmd_line, get_process_info()->binary_file_path);
str8_list_pushf(scratch.arena, &params.cmd_line, "--bin"); str8_list_pushf(scratch.arena, &params.cmd_line, "--bin");
str8_list_pushf(scratch.arena, &params.cmd_line, "--quiet"); str8_list_pushf(scratch.arena, &params.cmd_line, "--quiet");
if(should_compress) if(should_compress)
+2 -2
View File
@@ -1548,8 +1548,8 @@ main(int argc, char **argv)
if(got_final_result && size > 0) if(got_final_result && size > 0)
{ {
String8 full_name = str8(buffer, size); String8 full_name = str8(buffer, size);
String8 name_chopped = str8_chop_last_slash(full_name); info->binary_file_path = push_str8_copy(os_lnx_state.arena, full_name);
info->binary_path = push_str8_copy(lnx_state.arena, name_chopped); info->binary_path = str8_chop_last_slash(info->binary_file_path);
} }
} }
@@ -0,0 +1 @@
+2 -2
View File
@@ -1893,8 +1893,8 @@ w32_entry_point_caller(int argc, WCHAR **wargv)
U16 *buffer = push_array_no_zero(scratch.arena, U16, size); U16 *buffer = push_array_no_zero(scratch.arena, U16, size);
DWORD length = GetModuleFileNameW(0, (WCHAR*)buffer, size); DWORD length = GetModuleFileNameW(0, (WCHAR*)buffer, size);
String8 name8 = str8_from_16(scratch.arena, str16(buffer, length)); String8 name8 = str8_from_16(scratch.arena, str16(buffer, length));
String8 name_chopped = str8_chop_last_slash(name8); info->binary_file_path = push_str8_copy(arena, name8);
info->binary_path = push_str8_copy(arena, name_chopped); info->binary_path = str8_chop_last_slash(info->binary_file_path);
scratch_end(scratch); scratch_end(scratch);
} }
info->initial_path = get_current_path(arena); info->initial_path = get_current_path(arena);