# HG changeset patch # User bpb # Date 1518452373 28800 # Node ID 81f3a5eaecb0f604981860c6975f659a36fe5783 # Parent da4b1106787eec9baaaf353d65455acf2939ff42 8197498: (se) kevent polling should ignore signal interrupt (EINTR) 8179307: Java_sun_nio_ch_KQueue_keventPoll throws an exception with "kqueue failed" instead of "kevent poll failed". Reviewed-by: alanb diff -r da4b1106787e -r 81f3a5eaecb0 src/java.base/macosx/native/libnio/ch/KQueueArrayWrapper.c --- a/src/java.base/macosx/native/libnio/ch/KQueueArrayWrapper.c Mon Feb 12 08:19:23 2018 -0800 +++ b/src/java.base/macosx/native/libnio/ch/KQueueArrayWrapper.c Mon Feb 12 08:19:33 2018 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ #include "jni_util.h" #include "jvm.h" #include "jlong.h" +#include "nio_util.h" #include #include @@ -153,15 +154,10 @@ tsp = NULL; } - result = kevent(kq, NULL, 0, kevs, kevCount, tsp); - + RESTARTABLE(kevent(kq, NULL, 0, kevs, kevCount, tsp), result); if (result < 0) { - if (errno == EINTR) { - // ignore EINTR, pretend nothing was selected - result = 0; - } else { - JNU_ThrowIOExceptionWithLastError(env, "KQueueArrayWrapper: kqueue failed"); - } + JNU_ThrowIOExceptionWithLastError(env, + "KQueueArrayWrapper: kevent poll failed"); } return result;