diff --git a/libs/libc/aio/lio_listio.c b/libs/libc/aio/lio_listio.c index 4703a888f8c..d194a45f5a2 100644 --- a/libs/libc/aio/lio_listio.c +++ b/libs/libc/aio/lio_listio.c @@ -657,7 +657,7 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent, * caller ourself? */ - else if (sig == NULL) + else if (sig != NULL) { if (nqueued > 0) { @@ -676,8 +676,7 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent, } else { - status = nxsig_notification(sighand->pid, &sighand->sig, - SI_ASYNCIO); + status = nxsig_notification(getpid(), sig, SI_ASYNCIO); if (status < 0 && ret == OK) { /* Something bad happened while performing the notification