summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2014-12-05 20:43:46 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2015-02-26 12:59:38 +0000
commit03a1c27274c210cede8c914e660e4d924104b458 (patch)
treec1d68ced2975952febe832fac19c96a35b9726ad
parent2c1c4a78b751faf6292483f0e4cda8bbdb283d2a (diff)
It's not an error if the XFree86_VT property doesn't exist
It's not an error if the XFree86_VT property doesn't exist, the server might not be Xorg Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r--xinit.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/xinit.c b/xinit.c
index 1b04911..0cbd800 100644
--- a/xinit.c
+++ b/xinit.c
@@ -497,11 +497,15 @@ setWindowPath(void)
}
if (XGetWindowProperty(xd, DefaultRootWindow(xd), prop, 0, 1,
False, AnyPropertyType, &actualtype, &actualformat,
- &nitems, &bytes_after, &buf)) {
- Errorx("No XFree86_VT property detected on X server, WINDOWPATH won't be set");
+ &nitems, &bytes_after, &buf) != Success) {
+ Errorx("XFree86_VT property fetch unexpectedly failed");
return;
}
- if (nitems != 1) {
+ if (nitems == 0) {
+ XFree(buf);
+ return;
+ }
+ else if (nitems != 1) {
Errorx("XFree86_VT property unexpectedly has %lu items instead of 1", nitems);
XFree(buf);
return;