8098535: Test closed/java/awt/Clipboard/ImageTransferTest/ImageTransferTest fails on OEL 7.1
authorssadetsky
Tue, 30 Jun 2015 10:45:32 +0300
changeset 31655 6bc54745fef4
parent 31654 9f95289d9553
child 31656 786638581dba
8098535: Test closed/java/awt/Clipboard/ImageTransferTest/ImageTransferTest fails on OEL 7.1 Reviewed-by: serb, azvegint
jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c	Mon Jun 29 13:47:28 2015 +0300
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c	Tue Jun 30 10:45:32 2015 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, 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
@@ -554,8 +554,10 @@
             curPollTimeout = min(AWT_MAX_POLL_TIMEOUT, curPollTimeout);
         } else if (timeout_control == TIMEOUT_EVENTS) {
             /* subtract 1/4 (plus 1, in case the division truncates to 0) */
-            curPollTimeout -= ((curPollTimeout>>2) + 1);
-            curPollTimeout = max(AWT_MIN_POLL_TIMEOUT, curPollTimeout);
+            if (curPollTimeout > 0) {
+                curPollTimeout -= ((curPollTimeout>>2) + 1);
+                curPollTimeout = max(AWT_MIN_POLL_TIMEOUT, curPollTimeout);
+            }
         }
         break;
     case AWT_POLL_AGING_FAST: