Bug 16154

Summary: xprop -spy does not flush output
Product: xorg Reporter: Kevin Pulo <kev>
Component: App/xpropAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: medium CC: kev, matthieu.herrb
Version: unspecifiedKeywords: janitor, patch
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Patch to add flushing to xprop -spy none

Description Kevin Pulo 2008-05-29 17:53:35 UTC
Created attachment 16813 [details] [review]
Patch to add flushing to xprop -spy

When piping the output of xprop -spy into a script, the output is buffered, and so the script does not see property changes immediately.  This does not show up when xprop -spy is run from a tty, since then the output is unbuffered by default.

The fix is simple, just fflush(stdout) when entering spy mode and after outputting each property, a patch is attached.
Comment 1 Matthieu Herrb 2008-06-19 10:48:26 UTC
Normally, when output is a tty output is line-buffered, so it should only matter in the script case. 
Otherwise, that patch looks good to me. Any reason not to commit it?
Comment 2 Paulo César Pereira de Andrade 2008-11-27 22:30:36 UTC
Thanks for the patch.

This was corrected in commit
9271b26d991608b562960aa041b0c371086cc490

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.