diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-02-11 22:37:39 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-02-11 23:31:14 -0500 |
commit | 5b3382dce406f2a520ff63b64d58f80e24ae74e2 (patch) | |
tree | 6b1ff097bb764ac394b8457b61c68ce5e6817131 /shmexport.c | |
parent | 80d869d92dceeab173525f80a5f973849d68433d (diff) | |
download | gpsd-5b3382dce406f2a520ff63b64d58f80e24ae74e2.tar.gz |
Instrument shm segment creation a bit better.
All regression tests pass.
Diffstat (limited to 'shmexport.c')
-rw-r--r-- | shmexport.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/shmexport.c b/shmexport.c index c9fe87b1..625f570a 100644 --- a/shmexport.c +++ b/shmexport.c @@ -35,14 +35,14 @@ bool shm_acquire(struct gps_context_t *context) /* initialize the shared-memory segment to be used for export */ { /*@-nullpass@*/ - int shmid = getenv("GPSD_SHM_KEY") ? atoi(getenv("GPSD_SHM_KEY")) : GPSD_KEY; + int shmkey = getenv("GPSD_SHM_KEY") ? atoi(getenv("GPSD_SHM_KEY")) : GPSD_KEY; /*@+nullpass@*/ - shmid = shmget((key_t)shmid, sizeof(struct gps_data_t), (int)(IPC_CREAT|0666)); + int shmid = shmget((key_t)shmkey, sizeof(struct gps_data_t), (int)(IPC_CREAT|0666)); if (shmid == -1) { gpsd_report(&context->errout, LOG_ERROR, "shmget(%ld, %zd, 0666) failed: %s\n", - (long int)shmid, + (long int)shmkey, sizeof(struct gps_data_t), strerror(errno)); return false; |