From 995976ab06a8f688343b8fec87e1305e2d5ee80e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 27 Aug 2014 16:42:04 -0400 Subject: The big leap. Most instances of gpsd_report are replaced... ...with calls to gps_notify(), which indirects to its output method through a slot in an errout structure. Usually the errout structure lives inside the session context, but because struct errout_t is its own thing this does not have to be the case. One large clique of gpsd_notify() calls, in packet.c and isgps.c, looks at a struct errout_t copy in a lexer control block This change is not complete. Remnant gpsd_report calls need to be changed, and gpsmon needs to be tweaked so that the struct_error_t in its context is a non-defaukt hook updating the cuses display rather than simply dumping to stderr. Also the report label functionality needs to be added. All regression tests pass. --- shmexport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'shmexport.c') diff --git a/shmexport.c b/shmexport.c index 4c6b7f96..adb379de 100644 --- a/shmexport.c +++ b/shmexport.c @@ -37,7 +37,7 @@ bool shm_acquire(struct gps_context_t *context) shmid = shmget((key_t)GPSD_KEY, sizeof(struct gps_data_t), (int)(IPC_CREAT|0666)); if (shmid == -1) { - gpsd_report(context->errout.debug, LOG_ERROR, + gpsd_notify(&context->errout, LOG_ERROR, "shmget(%ld, %zd, 0666) failed: %s\n", (long int)GPSD_KEY, sizeof(struct gps_data_t), @@ -46,11 +46,11 @@ bool shm_acquire(struct gps_context_t *context) } context->shmexport = (char *)shmat(shmid, 0, 0); if ((int)(long)context->shmexport == -1) { - gpsd_report(context->errout.debug, LOG_ERROR, "shmat failed: %s\n", strerror(errno)); + gpsd_notify(&context->errout, LOG_ERROR, "shmat failed: %s\n", strerror(errno)); context->shmexport = NULL; return false; } - gpsd_report(context->errout.debug, LOG_PROG, + gpsd_notify(&context->errout, LOG_PROG, "shmat() succeeded, segment %d\n", shmid); return true; } -- cgit v1.2.1