diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-10-07 09:57:20 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-10-07 09:57:20 -0600 |
commit | e4ac3239e0b0c22b2e911d739b69eaa7f69b3190 (patch) | |
tree | 72d7be137b6ac4b6c2f01d22cfa21e934bf9cb31 /nuttx | |
parent | 7c30b9eec161af92106dfa0daf1d0ea1590a8559 (diff) | |
download | px4-nuttx-e4ac3239e0b0c22b2e911d739b69eaa7f69b3190.tar.gz px4-nuttx-e4ac3239e0b0c22b2e911d739b69eaa7f69b3190.tar.bz2 px4-nuttx-e4ac3239e0b0c22b2e911d739b69eaa7f69b3190.zip |
AIO signal related fixes; extensino to AIO test
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/fs/aio/aio_signal.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/nuttx/fs/aio/aio_signal.c b/nuttx/fs/aio/aio_signal.c index 3e46f95da..9545a8622 100644 --- a/nuttx/fs/aio/aio_signal.c +++ b/nuttx/fs/aio/aio_signal.c @@ -96,6 +96,9 @@ int aio_signal(pid_t pid, FAR struct aiocb *aiocbp) { +#ifdef CONFIG_CAN_PASS_STRUCTS + union sigval value; +#endif int errcode; int status; int ret; @@ -115,10 +118,10 @@ int aio_signal(pid_t pid, FAR struct aiocb *aiocbp) status = sigqueue(pid, aiocbp->aio_sigevent.sigev_sign, aiocbp->aio_sigevent.sigev_value.sival_ptr); #endif - if (ret < 0) + if (status < 0) { errcode = get_errno(); - fdbg("ERROR: sigqueue failed: %d\n", errcode); + fdbg("ERROR: sigqueue #1 failed: %d\n", errcode); ret = ERROR; } } @@ -127,11 +130,16 @@ int aio_signal(pid_t pid, FAR struct aiocb *aiocbp) * on sig_suspend(); */ - status = kill(pid, SIGPOLL); +#ifdef CONFIG_CAN_PASS_STRUCTS + value.sival_ptr = aiocbp; + status = sigqueue(pid, SIGPOLL, value); +#else + status = sigqueue(pid, SIGPOLL, aiocbp); +#endif if (status && ret == OK) { errcode = get_errno(); - fdbg("ERROR: kill failed: %d\n", errcode); + fdbg("ERROR: sigqueue #2 failed: %d\n", errcode); ret = ERROR; } |