summaryrefslogtreecommitdiff
path: root/Libraries/LibC
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2020-09-12 01:07:36 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-12 13:46:15 +0200
commit8280dcfb89466bdc8ce3791e2792146586511fa8 (patch)
tree046443956616ee0ab7994443974efe1e10a7b8d1 /Libraries/LibC
parentbe1e4f28cc2c4768d0388d1b8047bf2eb6867095 (diff)
downloadserenity-8280dcfb89466bdc8ce3791e2792146586511fa8.zip
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.
Diffstat (limited to 'Libraries/LibC')
-rw-r--r--Libraries/LibC/unistd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibC/unistd.cpp b/Libraries/LibC/unistd.cpp
index 4c7df9f0ce..f2fe6a379c 100644
--- a/Libraries/LibC/unistd.cpp
+++ b/Libraries/LibC/unistd.cpp
@@ -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;
}