projects
/
platform
/
upstream
/
weston.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3170012
)
xwm: Check result of xcb_get_atom_name_reply
author
MoD
<mod-oss@hush.ai>
Wed, 12 Jun 2013 00:59:42 +0000
(19:59 -0500)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Fri, 14 Jun 2013 18:40:43 +0000
(14:40 -0400)
When printing debug information about atoms, the XWM would crash if the X
server failed to respond to a request about atom names. In practice this
occurred when the server itself crashed, e.g. when starting mplayer with the
"xv" vo.
src/xwayland/window-manager.c
patch
|
blob
|
history
diff --git
a/src/xwayland/window-manager.c
b/src/xwayland/window-manager.c
index
e656eda
..
3fc5633
100644
(file)
--- a/
src/xwayland/window-manager.c
+++ b/
src/xwayland/window-manager.c
@@
-137,9
+137,15
@@
get_atom_name(xcb_connection_t *c, xcb_atom_t atom)
cookie = xcb_get_atom_name (c, atom);
reply = xcb_get_atom_name_reply (c, cookie, &e);
- snprintf(buffer, sizeof buffer, "%.*s",
- xcb_get_atom_name_name_length (reply),
- xcb_get_atom_name_name (reply));
+
+ if(reply) {
+ snprintf(buffer, sizeof buffer, "%.*s",
+ xcb_get_atom_name_name_length (reply),
+ xcb_get_atom_name_name (reply));
+ } else {
+ snprintf(buffer, sizeof buffer, "(atom %u)", atom);
+ }
+
free(reply);
return buffer;