aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-03-11 15:56:05 +0000
committerCorinna Vinschen <corinna@vinschen.de>2011-03-11 15:56:05 +0000
commitaf2861c7e16a59ad8ddd5d910f3c162e32cfb4df (patch)
treed1bef70f81eb5bf9433e121587471959bea8acd8
parent020df9fe5f161da307ea7348be23588e729c0211 (diff)
downloadnewlib-af2861c7e16a59ad8ddd5d910f3c162e32cfb4df.zip
newlib-af2861c7e16a59ad8ddd5d910f3c162e32cfb4df.tar.gz
newlib-af2861c7e16a59ad8ddd5d910f3c162e32cfb4df.tar.bz2
* times.cc (clock_setres): Use status code from NtSetTimerResolution
to compute errno.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/times.cc6
2 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 700fcaf..0e0ba1e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2011-03-11 Corinna Vinschen <corinna@vinschen.de>
+ * times.cc (clock_setres): Use status code from NtSetTimerResolution
+ to compute errno.
+
+2011-03-11 Corinna Vinschen <corinna@vinschen.de>
+
* cygwin.din (pthread_spin_destroy): Export.
(pthread_spin_init): Export.
(pthread_spin_lock): Export.
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index c65a979..ad41683 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -863,6 +863,7 @@ extern "C" int
clock_setres (clockid_t clk_id, struct timespec *tp)
{
static NO_COPY bool period_set;
+ int status;
if (clk_id != CLOCK_REALTIME)
{
@@ -887,9 +888,10 @@ clock_setres (clockid_t clk_id, struct timespec *tp)
&& NT_SUCCESS (NtSetTimerResolution (minperiod * 10000L, FALSE, &actual)))
period_set = false;
- if (!NT_SUCCESS (NtSetTimerResolution (period * 10000L, TRUE, &actual)))
+ status = NtSetTimerResolution (period * 10000L, TRUE, &actual);
+ if (!NT_SUCCESS (status))
{
- __seterrno ();
+ __seterrno_from_nt_status (status);
return -1;
}
minperiod = actual / 10000L;