diff options
author | Mike Fulbright <msf@redhat.com> | 2002-11-13 21:38:54 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2002-11-13 21:38:54 +0000 |
commit | 0694ca92ac6d6b72548e7c6478a0bc0610864be0 (patch) | |
tree | bd8382ac60cddae28ad82dbcc53b5e53a35b624c /xutils.c | |
parent | f91b36569bb85888c2a1ac8d26354ba40541c202 (diff) | |
download | anaconda-0694ca92ac6d6b72548e7c6478a0bc0610864be0.tar.gz anaconda-0694ca92ac6d6b72548e7c6478a0bc0610864be0.tar.xz anaconda-0694ca92ac6d6b72548e7c6478a0bc0610864be0.zip |
handle x server going away after starting up better
Diffstat (limited to 'xutils.c')
-rw-r--r-- | xutils.c | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -153,8 +153,10 @@ getRootResources(PyObject *s, PyObject *args) { Resource **resources, **p; PyObject *rc; - if (openDisplay(&dpy, &root) < 0) + if (openDisplay(&dpy, &root) < 0) { + PyErr_SetString(PyExc_SystemError, "Could not open display."); return NULL; + } resources = getCurrentResources(dpy); if (!resources) { @@ -185,11 +187,14 @@ setRootResource(PyObject *s, PyObject *args) char *key, *val, *rstring; int fnd, nrec; - if (!PyArg_ParseTuple(args, "ss", &key, &val)) + if (!PyArg_ParseTuple(args, "ss", &key, &val)) { return NULL; + } - if (openDisplay(&dpy, &root) < 0) + if (openDisplay(&dpy, &root) < 0) { + PyErr_SetString(PyExc_SystemError, "Could not open display."); return NULL; + } resources = getCurrentResources(dpy); fnd = 0; @@ -273,8 +278,10 @@ screenHeight(PyObject *s, PyObject *args) int scrn; PyObject *rc; - if (openDisplay(&dpy, &root) < 0) + if (openDisplay(&dpy, &root) < 0) { + PyErr_SetString(PyExc_SystemError, "Could not open display."); return NULL; + } scrn=DefaultScreen(dpy); @@ -292,8 +299,10 @@ screenWidth(PyObject *s, PyObject *args) int scrn; PyObject *rc; - if (openDisplay(&dpy, &root) < 0) + if (openDisplay(&dpy, &root) < 0) { + PyErr_SetString(PyExc_SystemError, "Could not open display."); return NULL; + } scrn=DefaultScreen(dpy); |