Commit 2b20d949 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] um: fix do_settimeofday() for new API

parent b82db9f3
...@@ -94,14 +94,21 @@ void do_gettimeofday(struct timeval *tv) ...@@ -94,14 +94,21 @@ void do_gettimeofday(struct timeval *tv)
time_unlock(flags); time_unlock(flags);
} }
void do_settimeofday(struct timeval *tv) int do_settimeofday(struct timespec *tv)
{ {
struct timeval now; struct timeval now;
unsigned long flags; unsigned long flags;
struct timeval tv_in;
if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
return -EINVAL;
tv_in.tv_sec = tv->tv_sec;
tv_in.tv_usec = tv->tv_nsec / 1000;
flags = time_lock(); flags = time_lock();
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
timersub(tv, &now, &local_offset); timersub(&tv_in, &now, &local_offset);
time_unlock(flags); time_unlock(flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment