summaryrefslogtreecommitdiff
path: root/gpsfake
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-11-19 13:26:41 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-11-19 13:26:41 -0500
commit06f235f46154541b032ed22095b77ff036c9cb17 (patch)
tree724df52ac673e2ee4ea05b16749c6996adf2c96a /gpsfake
parent016542ab0d0674106f8b1700974422f2160b37a1 (diff)
downloadgpsd-06f235f46154541b032ed22095b77ff036c9cb17.tar.gz
Simplify the build. No logic changes.
Diffstat (limited to 'gpsfake')
-rwxr-xr-xgpsfake8
1 files changed, 7 insertions, 1 deletions
diff --git a/gpsfake b/gpsfake
index 628ec0f1..ece89554 100755
--- a/gpsfake
+++ b/gpsfake
@@ -9,7 +9,7 @@
# This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.
-import sys, os, time, getopt, socket, random
+import sys, os, time, getopt, socket, random, pty
import gps, gps.fake as gpsfake # The "as" pacifies pychecker
class Baton:
@@ -157,6 +157,12 @@ if __name__ == '__main__':
sys.stderr.write("usage: gpsfake [-h] [-l] [-m monitor] [--D debug] [-o options] [-p] [-s speed] [-c cycle] [-b] logfile\n")
raise SystemExit,0
+ try:
+ pty.openpty()
+ except Exception:
+ print >>sys.stderr, "gpsfake: ptys not available, falling back to UDP."
+ udp = True
+
if not arguments:
print >>sys.stderr, "gpsfake: requires at least one logfile argument."
raise SystemExit, 1