xlsatoms: Changes to 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 12 19:48:38 UTC 2018


 man/xlsatoms.man |    2 -
 xlsatoms.c       |  104 ++++++++++++++++++++++++++++++-------------------------
 2 files changed, 58 insertions(+), 48 deletions(-)

New commits:
commit 1ffbd9c5be8fb61bcbe9bb06d349af54bfbb2f3b
Author: Tobias Stoeckmann <tobias at stoeckmann.org>
Date:   Wed Jul 4 15:33:18 2018 +0200

    Adjust man page to show default format.
    
    The default format is %lu\t%s, not %ld\t%s, i.e. unsigned.
    
    Signed-off-by: Tobias Stoeckmann <tobias at stoeckmann.org>
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 52a6e57bfd7f273fc754c12a44eb94200f3de0b9
Author: Tobias Stoeckmann <tobias at stoeckmann.org>
Date:   Wed Jul 4 15:29:58 2018 +0200

    Always use chunks when retrieving atoms.
    
    If a low and high range limit has been specified, all atoms are
    retrieved at once. This is also the reason why malloc() is used:
    All cookies are stored before collecting the data.
    
    By using chunks it is possible to specify a huge range or even
    all possible atoms without running out of memory.
    
    Signed-off-by: Tobias Stoeckmann <tobias at stoeckmann.org>
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 3e27b6a63f3baf153bba076e12870f2a88691a13
Author: Tobias Stoeckmann <tobias at stoeckmann.org>
Date:   Wed Jul 4 15:29:26 2018 +0200

    Actually stop after an invalid atom.
    
    The manual page states that if no upper range limit has been specified,
    no higher atoms will be printed. This is not true for
    
    $ xlsatoms -range 0-
    
    This prints the first 100 atoms, even though it already encountered an
    invalid one at 0. The reason is that say_batch works as a batch, i.e.
    retrieves 100 atoms at a time. If one of them is invalid, the rest is
    still printed.
    
    With this adjustment, xlsatoms behaves as stated in manual page.
    
    Signed-off-by: Tobias Stoeckmann <tobias at stoeckmann.org>
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 22a8eb00662a926cd5df52ba15851a31104ae41e
Author: Tobias Stoeckmann <tobias at stoeckmann.org>
Date:   Wed Jul 4 15:28:41 2018 +0200

    Support xcb_atom_t in range specification.
    
    The data type xcb_atom_t is an unsigned int (32 bit), but the optional
    range argument is parsed with atoi(), which returns a signed int.
    
    Even though it is possible to reach all values through clever casting,
    it is more readable by properly using correct data types.
    
    This also fixes a segmentation fault on 32 bit systems if a range is
    supplied which overflows size_t:
    
    $ xlsatoms -range 0-1073741824
    Segmentation fault (core dumped)
    
    If an invalid range is supplied, an error message is printed. This is
    new because previously an invalid range was silently accepted.
    
    $ xlsatoms -range 0--1
    $ _
    $ xlsatoms-new -range 0--1
    xlsatoms-new:  invalid range: 0--1
    
    Signed-off-by: Tobias Stoeckmann <tobias at stoeckmann.org>
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>



More information about the xorg-commit mailing list