diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-11-30 23:13:36 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2020-06-11 16:13:02 +0100 |
commit | 3c8ca8df3ec5c3dac2ba87729dc321712e5a4e53 (patch) | |
tree | da02e35e5c4f2a6960e455908615da4e8e0e661c | |
parent | d2fd8884c286d3b994feb981a0046b9f83e1bf85 (diff) |
regress: playback: check poll sanity
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r-- | regress/hplayback.c.m4 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/regress/hplayback.c.m4 b/regress/hplayback.c.m4 index 4fb1204..4ab05c1 100644 --- a/regress/hplayback.c.m4 +++ b/regress/hplayback.c.m4 @@ -257,10 +257,12 @@ static void Ppollfds(struct pollfd *fds, int nfds) { if (vb2.buf[vb2.used++] != hm_squote[hm_squote) Psyntax("pollfds start not ["); for (i=0; i<nfds; i++) { Pstring("{fd=","{fd= in pollfds"); - fds->fd= strtoul(vb2.buf+vb2.used,&ep,10); + int gotfd= strtoul(vb2.buf+vb2.used,&ep,10); + if (gotfd != fds->fd) Psyntax("poll fds[].fd changed"); vb2.used= ep - (char*)vb2.buf; Pstring(", events=",", events= in pollfds"); - fds->events= Ppollfdevents(); + int gotevents= Ppollfdevents(); + if (gotevents != fds->events) Psyntax("poll fds[].events changed"); Pstring(", revents=",", revents= in pollfds"); fds->revents= Ppollfdevents(); Pstring("}","} in pollfds"); |