LibC: Avoid write-back of unused value

This might make sleep() faster by up to pi nanoseconds, or less.
It's more about avoiding a senseless write than about optimization.
This commit is contained in:
Ben Wiederhake 2020-09-12 01:07:36 +02:00 committed by Andreas Kling
parent be1e4f28cc
commit 8280dcfb89
Notes: sideshowbarker 2024-07-19 02:44:09 +09:00

View file

@ -334,7 +334,7 @@ char* getwd(char* buf)
int sleep(unsigned seconds)
{
struct timespec ts = { seconds, 0 };
if (clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts) < 0)
if (clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, nullptr) < 0)
return ts.tv_sec;
return 0;
}