mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-05 13:28:40 +00:00
cursed early return
This commit is contained in:
@@ -158,16 +158,17 @@ internal U32
|
|||||||
os_get_process_start_time_unix(void)
|
os_get_process_start_time_unix(void)
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(0,0);
|
Temp scratch = scratch_begin(0,0);
|
||||||
|
U64 start_time = 0;
|
||||||
pid_t pid = getpid();
|
pid_t pid = getpid();
|
||||||
String8 path = push_str8f(scratch.arena, "/proc/%u", pid);
|
String8 path = push_str8f(scratch.arena, "/proc/%u", pid);
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int err = stat((char*)path.str, &st);
|
int err = stat((char*)path.str, &st);
|
||||||
if(err == 0)
|
if(err == 0)
|
||||||
{
|
{
|
||||||
return (U32)st.st_mtime;
|
start_time = st.st_mtime;
|
||||||
}
|
}
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
return 0;
|
return (U32)start_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user