Explorar o código

fix type error (arch-dependent) in new aio code

a_store is only valid for int, but ssize_t may be defined as long or
another type. since there is no valid way for another thread to acess
the return value without first checking the error/completion status of
the aiocb anyway, an atomic store is not necessary.
Rich Felker %!s(int64=10) %!d(string=hai) anos
pai
achega
fd850de752
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/aio/aio.c

+ 1 - 1
src/aio/aio.c

@@ -148,7 +148,7 @@ static void cleanup(void *ctx)
 	 * Types 1-3 are notified via atomics/futexes, mainly for AS-safety
 	 * considerations. Type 4 is notified later via a cond var. */
 
-	a_store(&cb->__ret, at->ret);
+	cb->__ret = at->ret;
 	if (a_swap(&at->running, 0) < 0)
 		__wake(&at->running, -1, 1);
 	if (a_swap(&cb->__err, at->err) != EINPROGRESS)