about summary refs log tree commit diff
path: root/linuxthreads/sysdeps/pthread/timer_settime.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-20 00:34:21 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-20 00:34:21 +0000
commitd2dfc5de011fb525161b85a1408f716a2ea358cc (patch)
tree22804aa59f348ac9d5bf432d2ddeb4c79ad31910 /linuxthreads/sysdeps/pthread/timer_settime.c
parentd620426811688301eb1cbe6e63773d6430b2706e (diff)
downloadglibc-d2dfc5de011fb525161b85a1408f716a2ea358cc.tar.gz
glibc-d2dfc5de011fb525161b85a1408f716a2ea358cc.tar.xz
glibc-d2dfc5de011fb525161b85a1408f716a2ea358cc.zip
Update.
	* iconv/gconv_int.h (strict gconv_module): Remove all members
	associated with regular expressions.  Use a simple string as the
	from name.
	* iconv/gconv_db.c: Remove code handling regular expressions.
	* iconv/gconv_conf.c: Likewise.
	* iconv/iconv_prog.c: Likewise.
	* iconv/gconv_builtin.h: Adjust for change in gconv_conf.c.
Diffstat (limited to 'linuxthreads/sysdeps/pthread/timer_settime.c')
-rw-r--r--linuxthreads/sysdeps/pthread/timer_settime.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/linuxthreads/sysdeps/pthread/timer_settime.c b/linuxthreads/sysdeps/pthread/timer_settime.c
index 858edc7657..e6c35b4fcf 100644
--- a/linuxthreads/sysdeps/pthread/timer_settime.c
+++ b/linuxthreads/sysdeps/pthread/timer_settime.c
@@ -41,7 +41,7 @@ timer_settime (timerid, flags, value, ovalue)
   timer = timer_id2ptr (timerid);
   if (timer == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       goto bail;
     }
 
@@ -50,7 +50,7 @@ timer_settime (timerid, flags, value, ovalue)
       || value->it_value.tv_nsec < 0
       || value->it_value.tv_nsec >= 1000000000)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       goto bail;
     }
 
@@ -64,13 +64,14 @@ timer_settime (timerid, flags, value, ovalue)
     }
 
   pthread_mutex_lock (&__timer_mutex);
+  timer_addref (timer);
 
   /* One final check of timer validity; this one is possible only
-     until we have the mutex, which guards the inuse flag. */
+     until we have the mutex, because it accesses the inuse flag. */
 
-  if (!timer->inuse)
+  if (! timer_valid(timer))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       goto unlock_bail;
     }
 
@@ -86,6 +87,7 @@ timer_settime (timerid, flags, value, ovalue)
 	      clock_gettime (timer->clock, &now);
 	      have_now = 1;
 	      pthread_mutex_lock (&__timer_mutex);
+	      timer_addref (timer);
 	    }
 
 	  timespec_sub (&ovalue->it_value, &timer->expirytime, &now);
@@ -123,6 +125,7 @@ timer_settime (timerid, flags, value, ovalue)
   retval = 0;
 
 unlock_bail:
+  timer_delref (timer);
   pthread_mutex_unlock (&__timer_mutex);
 
 bail: