diff options
author | Nathan Scott <nathans@redhat.com> | 2021-04-08 09:26:48 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2021-04-09 10:43:33 +1000 |
commit | 367561175ab9da93d5c21861ec6c6b52933ccf15 (patch) | |
tree | 4aedda319b0f6cebb8def738f636d9aed873b213 /CommandLine.c | |
parent | f3a37f9ef33cf5459acf1c5352f9c8104cce8806 (diff) |
Update timestamps for the special process scans at startup also
Resolves https://github.com/htop-dev/htop/issues/592
Diffstat (limited to 'CommandLine.c')
-rw-r--r-- | CommandLine.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/CommandLine.c b/CommandLine.c index bd17c696..796018af 100644 --- a/CommandLine.c +++ b/CommandLine.c @@ -241,14 +241,14 @@ static CommandLineSettings parseArguments(const char* program, int argc, char** return flags; } -static void millisleep(unsigned long millisec) { +static void CommandLine_delay(ProcessList* pl, unsigned long millisec) { struct timespec req = { .tv_sec = 0, .tv_nsec = millisec * 1000000L }; - while(nanosleep(&req,&req)==-1) { + while (nanosleep(&req, &req) == -1) continue; - } + Platform_gettime_realtime(&pl->realtime, &pl->realtimeMs); } static void setCommFilter(State* state, char** commFilter) { @@ -333,7 +333,7 @@ int CommandLine_run(const char* name, int argc, char** argv) { ScreenManager_add(scr, (Panel*) panel, -1); ProcessList_scan(pl, false); - millisleep(75); + CommandLine_delay(pl, 75); ProcessList_scan(pl, false); if (settings->allBranchesCollapsed) |