summaryrefslogtreecommitdiff
path: root/libgps_shm.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-02-16 06:13:24 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-02-16 06:13:24 -0500
commitd607c875a0999bd29c4db7c92182c8c193379d2a (patch)
treef0013a19aa4b213cd8cc229d21c74236b5d9575e /libgps_shm.c
parente7e4ef68e8ee9e1f33493f0f57551dfadbbcde54 (diff)
downloadgpsd-d607c875a0999bd29c4db7c92182c8c193379d2a.tar.gz
Repair the logic for setting a non-default SHM export segment.
Also, ensure this always happens within the regression-test driver. All regression tests pass.
Diffstat (limited to 'libgps_shm.c')
-rw-r--r--libgps_shm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgps_shm.c b/libgps_shm.c
index fda963da..9cb23e19 100644
--- a/libgps_shm.c
+++ b/libgps_shm.c
@@ -44,7 +44,7 @@ int gps_shm_open(/*@out@*/struct gps_data_t *gpsdata)
int shmid;
/*@-nullpass@*/
- int shmkey = getenv("GPSD_SHM_KEY") ? atoi(getenv("GPSD_SHM_KEY")) : GPSD_KEY;
+ long shmkey = getenv("GPSD_SHM_KEY") ? strtol(getenv("GPSD_SHM_KEY"), NULL, 0) : GPSD_SHM_KEY;
/*@+nullpass@*/
libgps_debug_trace((DEBUG_CALLS, "gps_shm_open()\n"));