summaryrefslogtreecommitdiff
path: root/src/libstddjb/iopause_ppoll.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-07-30 13:12:52 +0000
committerLaurent Bercot <ska@appnovation.com>2024-07-30 13:12:52 +0000
commit92d5c03ef86fbd21a84d9425c456f01e6c513817 (patch)
treec9409cd5fbe78a7d2d1d9e2468aed4cfeb402ae0 /src/libstddjb/iopause_ppoll.c
parentcc57ca6ab355784f4901009184ea95a9f915ef21 (diff)
downloadskalibs-92d5c03ef86fbd21a84d9425c456f01e6c513817.tar.xz
Fix small bugs, add autodelegation for IOPAUSE_EXCEPT
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libstddjb/iopause_ppoll.c')
-rw-r--r--src/libstddjb/iopause_ppoll.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libstddjb/iopause_ppoll.c b/src/libstddjb/iopause_ppoll.c
index 336bf8e..6194d17 100644
--- a/src/libstddjb/iopause_ppoll.c
+++ b/src/libstddjb/iopause_ppoll.c
@@ -13,6 +13,7 @@
int iopause_ppoll (iopause_fd *x, unsigned int len, tain const *deadline, tain const *stamp)
{
+ int r ;
struct timespec ts = { .tv_sec = 0, .tv_nsec = 0 } ;
if (deadline && tain_less(stamp, deadline))
{
@@ -24,7 +25,12 @@ int iopause_ppoll (iopause_fd *x, unsigned int len, tain const *deadline, tain c
else deadline = 0 ;
}
}
- return ppoll(x, len, deadline ? &ts : 0, 0) ;
+ r = ppoll(x, len, deadline ? &ts : 0, 0) ;
+ if (r > 0)
+ for (unsigned int i = 0 ; i < len ; i++)
+ if (x[i].revents & IOPAUSE_EXCEPT)
+ x[i].revents |= x[i].events ;
+ return r ;
}
#else