summaryrefslogtreecommitdiff
path: root/shmexport.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-02-16 05:47:58 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-02-16 05:47:58 -0500
commite7e4ef68e8ee9e1f33493f0f57551dfadbbcde54 (patch)
treec866f39b5e6b6bc7f95739329b0c662653c32f06 /shmexport.c
parent7e15f0cbf72a5710195e0d717d528c1ae9ed585e (diff)
downloadgpsd-e7e4ef68e8ee9e1f33493f0f57551dfadbbcde54.tar.gz
Tweak instrumentation to find out why alternate export segment isn't being set.
All regression tests pass. No logic changes.
Diffstat (limited to 'shmexport.c')
-rw-r--r--shmexport.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/shmexport.c b/shmexport.c
index 625f570a..229ad697 100644
--- a/shmexport.c
+++ b/shmexport.c
@@ -41,12 +41,17 @@ bool shm_acquire(struct gps_context_t *context)
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)shmkey,
+ "shmget(%x, %zd, 0666) for SHM export failed: %s\n",
+ shmkey,
sizeof(struct gps_data_t),
strerror(errno));
return false;
- }
+ } else
+ gpsd_report(&context->errout, LOG_PROG,
+ "shmget(%x, %zd, 0666) for SHM export succeeded\n",
+ shmkey,
+ sizeof(struct gps_data_t));
+
context->shmexport = (void *)shmat(shmid, 0, 0);
if ((int)(long)context->shmexport == -1) {
gpsd_report(&context->errout, LOG_ERROR, "shmat failed: %s\n", strerror(errno));
@@ -54,7 +59,7 @@ bool shm_acquire(struct gps_context_t *context)
return false;
}
gpsd_report(&context->errout, LOG_PROG,
- "shmat() succeeded, segment %d\n", shmid);
+ "shmat() for SHM export succeeded, segment %d\n", shmid);
return true;
}