Skip to content

Commit

Permalink
Fixes bug in gpsfake with default port.
Browse files Browse the repository at this point in the history
The default port number used by gpsfake is (probably incorrectly)
specified as a string rather than an integer.  The shmkey derivation
added in commit 1f20945 expects an integer, causing a failure when
the port is not explicitly specified.  This fix forces an integer
where needed.

TESTED:
Ran "scons build-all check".
Previously failing gpsfake case now works correctly.
  • Loading branch information
fhgwright committed Jul 14, 2017
1 parent 8fc40f9 commit 81e3562
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gps/fake.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def spawn(self, options, port, background=False, prefix=""):
% (port, self.control_socket, options))
# Derive a unique SHM key from the port # to avoid collisions.
# Use 'Gp' as the prefix to avoid colliding with 'GPSD'.
shmkey = '0x4770%.04X' % port
shmkey = '0x4770%.04X' % int(port)
env = {'GPSD_SHM_KEY': shmkey}
super(DaemonInstance, self).spawn('gpsd', opts, background, prefix,
env)
Expand Down

0 comments on commit 81e3562

Please sign in to comment.