summaryrefslogtreecommitdiff
path: root/shmexport.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-07 11:51:15 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-03-07 11:51:15 -0500
commitdf34a3add8df382eb852a67635c6859ee8cc657f (patch)
treec52183ba41403d093ad1ac971fa45c4ba1289f0c /shmexport.c
parent9c49083f2afe799343a610912b0ed404b2ffad05 (diff)
downloadgpsd-df34a3add8df382eb852a67635c6859ee8cc657f.tar.gz
gpsd-report() -> gpsd_log()
This change is done so we can add a "log" hook to the pps_thread_t structure (this is not done yet) and harmonize with the name of the outer logging function. If that name had been left as gpsd_report() there would have been scope for bad confusion with the report_hook member. Also, remove two stray duplicative printf calls from the NMEA2000 driver (drivers shouldn't have printfs!) and fix one typo. This is a step towards factoring out ntplib. For that to happen, the PPS thread code needs to be decoupled from the core session structure. No logic changes. Object compatibility preserved. All regression tests pass.
Diffstat (limited to 'shmexport.c')
-rw-r--r--shmexport.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/shmexport.c b/shmexport.c
index 3b2f6d8f..4bfe750a 100644
--- a/shmexport.c
+++ b/shmexport.c
@@ -40,26 +40,27 @@ 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(0x%lx, %zd, 0666) for SHM export failed: %s\n",
- shmkey,
- sizeof(struct gps_data_t),
- strerror(errno));
+ gpsd_log(&context->errout, LOG_ERROR,
+ "shmget(0x%lx, %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(0x%lx, %zd, 0666) for SHM export succeeded\n",
- shmkey,
- sizeof(struct gps_data_t));
+ gpsd_log(&context->errout, LOG_PROG,
+ "shmget(0x%lx, %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));
+ gpsd_log(&context->errout, LOG_ERROR,
+ "shmat failed: %s\n", strerror(errno));
context->shmexport = NULL;
return false;
}
- gpsd_report(&context->errout, LOG_PROG,
- "shmat() for SHM export succeeded, segment %d\n", shmid);
+ gpsd_log(&context->errout, LOG_PROG,
+ "shmat() for SHM export succeeded, segment %d\n", shmid);
return true;
}