commit 7e9e092da8d0c91c8075d9f0a4b1700de8f46753 parent 1d620367bd070f2eae99a70f8537c701a737650a 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(-)
diff --git a/src/libdraw/x11-itrans.c b/src/libdraw/x11-itrans.c @@ -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;