diff mbox

22.t: fix check for POLLIN

Message ID 20180523161407.30689-2-hch@lst.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christoph Hellwig May 23, 2018, 4:14 p.m. UTC
Recent kernels seem to also set POLLRDNORM in addition to POLLIN,
so check by masking instead of equality.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 harness/cases/22.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeff Moyer May 23, 2018, 4:19 p.m. UTC | #1
Christoph Hellwig <hch@lst.de> writes:

> Recent kernels seem to also set POLLRDNORM in addition to POLLIN,
> so check by masking instead of equality.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Thanks, Christoph, I'll pull this in.

-Jeff

> ---
>  harness/cases/22.t | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/harness/cases/22.t b/harness/cases/22.t
> index c7e7c0e..f376afc 100644
> --- a/harness/cases/22.t
> +++ b/harness/cases/22.t
> @@ -139,7 +139,7 @@ int test_main(void)
>  			printf("parent: io_pgetevents reports wrong fd\n");
>  			return 1;
>  		}
> -		if (ev.res != POLLIN) {
> +		if (!(ev.res & POLLIN)) {
>  			printf("parent: io_pgetevents did not report readable fd\n");
>  			return 1;
>  		}
diff mbox

Patch

diff --git a/harness/cases/22.t b/harness/cases/22.t
index c7e7c0e..f376afc 100644
--- a/harness/cases/22.t
+++ b/harness/cases/22.t
@@ -139,7 +139,7 @@  int test_main(void)
 			printf("parent: io_pgetevents reports wrong fd\n");
 			return 1;
 		}
-		if (ev.res != POLLIN) {
+		if (!(ev.res & POLLIN)) {
 			printf("parent: io_pgetevents did not report readable fd\n");
 			return 1;
 		}