summaryrefslogtreecommitdiff
path: root/gpsfake
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-04-03 06:19:40 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-04-03 06:19:40 +0000
commitb5dc263522dc5189652cd52f639211863478c1e5 (patch)
tree984297b71ec0ff525ebbf3fa1be1de8f493aec98 /gpsfake
parent589841652d36f82a657da34e7fee54d81ebe2ae8 (diff)
downloadgpsd-b5dc263522dc5189652cd52f639211863478c1e5.tar.gz
Device list editing through a separate control socket.
Diffstat (limited to 'gpsfake')
-rwxr-xr-xgpsfake6
1 files changed, 4 insertions, 2 deletions
diff --git a/gpsfake b/gpsfake
index 2674c333..8cc3005c 100755
--- a/gpsfake
+++ b/gpsfake
@@ -35,9 +35,11 @@ except:
sys.exit(1)
slave = os.ttyname(slave_fd)
-spawncmd = "gpsd -N -P /tmp/gpsfake%d -f %s %s" % (os.getpid(),slave,doptions)
+spawncmd = "gpsd -N -P %s -f %s %s" % (pidfile, slave, doptions)
spawncmd = spawncmd.strip()
+pidfile = "/tmp/gpsfake_pid-%s" % os.getpid()
+
if not spawn:
raw_input("gpsfake: launch '%s' and press enter..." % spawncmd)
elif os.system(spawncmd + " &"):
@@ -46,7 +48,7 @@ elif os.system(spawncmd + " &"):
else:
sys.stderr.write("gpsfake: '%s' launch OK.\n" % spawncmd)
- fp = open("/tmp/gpsfake%s" % os.getpid())
+ fp = open(pidfile)
pid = int(fp.read())
fp.close()
os.remove("/tmp/gpsfake%s" % os.getpid())