default ps -W process start time to system boot time when inaccessible, 0, -1
This commit is contained in:
parent
5737045c00
commit
ee1ad64234
|
@ -337,6 +337,17 @@ main (int argc, char *argv[])
|
||||||
p->start_time = to_time_t (&ct);
|
p->start_time = to_time_t (&ct);
|
||||||
CloseHandle (h);
|
CloseHandle (h);
|
||||||
}
|
}
|
||||||
|
if (!h || 0 == p->start_time || -1 == p->start_time)
|
||||||
|
{
|
||||||
|
SYSTEM_TIMEOFDAY_INFORMATION stodi;
|
||||||
|
status = NtQuerySystemInformation (SystemTimeOfDayInformation,
|
||||||
|
(PVOID) &stodi, sizeof stodi, NULL);
|
||||||
|
if (!NT_SUCCESS (status))
|
||||||
|
fprintf (stderr,
|
||||||
|
"NtQuerySystemInformation(SystemTimeOfDayInformation), "
|
||||||
|
"status %08x", status);
|
||||||
|
p->start_time = to_time_t ((FILETIME*)&stodi.BootTime);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char uname[128];
|
char uname[128];
|
||||||
|
|
Loading…
Reference in New Issue