summaryrefslogtreecommitdiff
path: root/libc/unistd/usleep.c
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2010-11-28 21:09:47 +0100
committerCarmelo Amoroso <carmelo.amoroso@st.com>2010-11-28 21:09:47 +0100
commit57f6cce72c889f2e7b342e87a565a064320a6ee2 (patch)
tree5466406472918d3adb63398f5fb9ea1511a5e73f /libc/unistd/usleep.c
parent4ec89b87bc0eea8d9ca6b50564d12eeb3b1b0119 (diff)
parent5dea871ac73ef4608022c058b50adc946917f9b9 (diff)
Merge commit 'origin/master' into prelink
Conflicts: ldso/include/dl-hash.h Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/unistd/usleep.c')
-rw-r--r--libc/unistd/usleep.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libc/unistd/usleep.c b/libc/unistd/usleep.c
index 61ddb900a..8d01703ec 100644
--- a/libc/unistd/usleep.c
+++ b/libc/unistd/usleep.c
@@ -14,19 +14,19 @@
int usleep (__useconds_t usec)
{
- const struct timespec ts = {
- .tv_sec = (long int) (usec / 1000000),
- .tv_nsec = (long int) (usec % 1000000) * 1000ul
- };
- return(nanosleep(&ts, NULL));
+ const struct timespec ts = {
+ .tv_sec = (long int) (usec / 1000000),
+ .tv_nsec = (long int) (usec % 1000000) * 1000ul
+ };
+ return nanosleep(&ts, NULL);
}
#else /* __UCLIBC_HAS_REALTIME__ */
int usleep (__useconds_t usec)
{
struct timeval tv;
- tv.tv_sec = 0;
- tv.tv_usec = usec;
+ tv.tv_sec = (long int) (usec / 1000000);
+ tv.tv_usec = (long int) (usec % 1000000);
return select(0, NULL, NULL, NULL, &tv);
}
#endif /* __UCLIBC_HAS_REALTIME__ */