tCorrect putsnarf-then-getsnarf race. - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 7e9e092da8d0c91c8075d9f0a4b1700de8f46753
(DIR) parent 1d620367bd070f2eae99a70f8537c701a737650a
(HTM) Author: rsc <devnull@localhost>
Date: Mon, 2 May 2005 04:20:14 +0000
Correct putsnarf-then-getsnarf race.
Diffstat:
M src/libdraw/x11-itrans.c | 6 ++++++
1 file changed, 6 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/src/libdraw/x11-itrans.c b/src/libdraw/x11-itrans.c
t@@ -375,6 +375,12 @@ _xgetsnarf(XDisplay *xd)
qlock(&clip.lk);
/*
+ * Have we snarfed recently and the X server hasn't caught up?
+ */
+ if(_x.putsnarf != _x.assertsnarf)
+ goto mine;
+
+ /*
* Is there a primary selection (highlighted text in an xterm)?
*/
clipboard = XA_PRIMARY;