mirror of
https://git.musl-libc.org/git/musl
synced 2025-02-20 20:24:28 +03:00
on failed aio submission, set aiocb error and return value
it's not clear whether this is required, but it seems arguable that it should happen. for example aio_suspend is supposed to return immediately if any of the operations has "completed", which includes ending with an error status asynchonously and might also be interpreted to include doing so synchronously.
This commit is contained in:
parent
a9a9882fbe
commit
c00cdefa1d
@ -280,6 +280,8 @@ static int submit(struct aiocb *cb, int op)
|
||||
|
||||
if (!q) {
|
||||
if (errno != EBADF) errno = EAGAIN;
|
||||
cb->__ret = -1;
|
||||
cb->__err = errno;
|
||||
return -1;
|
||||
}
|
||||
q->ref++;
|
||||
@ -303,8 +305,8 @@ static int submit(struct aiocb *cb, int op)
|
||||
if (pthread_create(&td, &a, io_thread_func, &args)) {
|
||||
pthread_mutex_lock(&q->lock);
|
||||
__aio_unref_queue(q);
|
||||
errno = EAGAIN;
|
||||
ret = -1;
|
||||
cb->__err = errno = EAGAIN;
|
||||
cb->__ret = ret = -1;
|
||||
}
|
||||
pthread_sigmask(SIG_SETMASK, &origmask, 0);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user