diff options
author | Gary E. Miller <gem@rellim.com> | 2018-12-27 19:57:33 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-12-27 19:57:33 -0800 |
commit | 41d3943276c922aed53984b3e5948b6814b35b0d (patch) | |
tree | ab9da8b17a013a9999c003f9c58c1ccb9fe74d7c /xgps | |
parent | 20845f4a6741e6c925dd386245ecfe5bee44b3fd (diff) | |
download | gpsd-41d3943276c922aed53984b3e5948b6814b35b0d.tar.gz |
xgps: Wanr, not segfault, on missing DISPLAY variable.
Diffstat (limited to 'xgps')
-rwxr-xr-x | xgps | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -25,12 +25,13 @@ usage: xgps [-?] [-D level] [-h] [-l degmfmt] [-r rotation] [-u units] [-V] # Preserve this property! from __future__ import absolute_import, print_function, division +import cairo import math +import os import socket import sys import time -import cairo # Gtk3 imports. Gtk3 requires the require_version(), which then causes # pylint to complain about the subsequent "non-top" imports. @@ -1304,6 +1305,10 @@ if __name__ == "__main__": else: target = "" + if 'DISPLAY' not in os.environ: + sys.stderr.write("xgps: ERROR: DISPLAY not set\n") + exit(1) + base = Base(deg_type=degreefmt, rotation=rotate, title=target) base.set_units(unit_system) try: |