diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-02-16 06:13:24 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-02-16 06:13:24 -0500 |
commit | d607c875a0999bd29c4db7c92182c8c193379d2a (patch) | |
tree | f0013a19aa4b213cd8cc229d21c74236b5d9575e /gpsctl.c | |
parent | e7e4ef68e8ee9e1f33493f0f57551dfadbbcde54 (diff) | |
download | gpsd-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 'gpsctl.c')
-rw-r--r-- | gpsctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -296,7 +296,7 @@ int main(int argc, char **argv) case 'R': /* remove the SHM export segment */ #ifdef SHM_EXPORT_ENABLE /*@-nullpass@*/ - status = shmget(getenv("GPSD_SHM_KEY") ? (key_t)atoi(getenv("GPSD_SHM_KEY")) : (key_t)GPSD_KEY, 0, 0); + status = shmget(getenv("GPSD_SHM_KEY") ? (key_t)strtol(getenv("GPSD_SHM_KEY"), NULL, 0) : (key_t)GPSD_SHM_KEY, 0, 0); if (status == -1) { gpsd_report(&context.errout, LOG_WARN, "GPSD SHM segment does not exist.\n"); |