diff options
-rw-r--r-- | driver_aivdm.c | 2 | ||||
-rw-r--r-- | driver_superstar2.c | 2 | ||||
-rw-r--r-- | gpsctl.c | 2 | ||||
-rw-r--r-- | gpsd.c | 33 | ||||
-rw-r--r-- | libgpsd_core.c | 2 | ||||
-rw-r--r-- | net_dgpsip.c | 4 | ||||
-rw-r--r-- | net_ntrip.c | 4 |
7 files changed, 24 insertions, 25 deletions
diff --git a/driver_aivdm.c b/driver_aivdm.c index 97a289f5..97a669b4 100644 --- a/driver_aivdm.c +++ b/driver_aivdm.c @@ -90,7 +90,7 @@ bool aivdm_decode(const char *buf, size_t buflen, return false; /* we may need to dump the raw packet */ - gpsd_report(LOG_PROG, "AIVDM packet length %zd: %s", buflen, buf); + gpsd_report(LOG_PROG, "AIVDM packet length %zd: %s\n", buflen, buf); /* extract packet fields */ (void)strlcpy((char *)ais_context->fieldcopy, buf, buflen); diff --git a/driver_superstar2.c b/driver_superstar2.c index 0ebd8df3..b241ff29 100644 --- a/driver_superstar2.c +++ b/driver_superstar2.c @@ -176,7 +176,7 @@ superstar2_msg_svinfo(struct gps_device_t *session, if (data_len != 67) return 0; - gpsd_report(LOG_PROG, "superstar2 #33 - satellite data"); + gpsd_report(LOG_PROG, "superstar2 #33 - satellite data\n"); nchan = 12; gpsd_zero_satellites(&session->gpsdata); @@ -475,7 +475,7 @@ int main(int argc, char **argv) device, gpsd_id(&session), session.gpsdata.dev.baudrate); if (forcetype!=NULL && strcmp("Generic NMEA", session.device_type->type_name) !=0 && strcmp(forcetype->type_name, session.device_type->type_name)!=0) { - gpsd_report(LOG_ERROR, "'%s' doesn't match non-generic type '%s' of selected device.", forcetype->type_name, session.device_type->type_name); + gpsd_report(LOG_ERROR, "'%s' doesn't match non-generic type '%s' of selected device.\n", forcetype->type_name, session.device_type->type_name); } /* @@ -257,8 +257,7 @@ void gpsd_report(int errlevel, const char *fmt, ...) buf2[0] = '\0'; for (sp = buf; *sp != '\0'; sp++) - if (isprint(*sp) - || (isspace(*sp) && (sp[1] == '\0' || sp[2] == '\0'))) + if (isprint(*sp)) (void)snprintf(buf2 + strlen(buf2), 2, "%c", *sp); else (void)snprintf(buf2 + strlen(buf2), 6, "\\x%02x", @@ -581,7 +580,7 @@ static ssize_t throttled_write(struct subscriber_t *sub, char *buf, if (debuglevel >= 3) { if (isprint(buf[0])) - gpsd_report(LOG_IO, "=> client(%d): %s", sub_index(sub), buf); + gpsd_report(LOG_IO, "=> client(%d): %s\n", sub_index(sub), buf); else { char *cp, buf2[MAX_PACKET_LENGTH * 3]; buf2[0] = '\0'; @@ -589,7 +588,7 @@ static ssize_t throttled_write(struct subscriber_t *sub, char *buf, (void)snprintf(buf2 + strlen(buf2), sizeof(buf2) - strlen(buf2), "%02x", (unsigned int)(*cp & 0xff)); - gpsd_report(LOG_IO, "=> client(%d): =%s\r\n", sub_index(sub), + gpsd_report(LOG_IO, "=> client(%d): =%s\n", sub_index(sub), buf2); } } @@ -804,7 +803,7 @@ static void handle_control(int sfd, char *buf) stash); ignore_return(write(sfd, "ERROR\n", 6)); } else { - gpsd_report(LOG_INF, "<= control(%d): adding %s \n", sfd, stash); + gpsd_report(LOG_INF, "<= control(%d): adding %s\n", sfd, stash); if (add_device(stash)) ignore_return(write(sfd, "OK\n", 3)); else @@ -834,7 +833,7 @@ static void handle_control(int sfd, char *buf) p = snarfline(buf + 1, &stash); eq = strchr(stash, '='); if (eq == NULL) { - gpsd_report(LOG_WARN, "<= control(%d): ill-formed command \n", + gpsd_report(LOG_WARN, "<= control(%d): ill-formed command\n", sfd); ignore_return(write(sfd, "ERROR\n", 6)); } else { @@ -1003,7 +1002,7 @@ static void handle_request(struct subscriber_t *sub, (void)snprintf(reply, replylen, "{\"class\":\"ERROR\",\"message\":\"Invalid WATCH: %s\"}\r\n", json_error_string(status)); - gpsd_report(LOG_ERROR, "ERROR response: %s", reply); + gpsd_report(LOG_ERROR, "ERROR response: %s\n", reply); } else if (sub->policy.watcher) { if (sub->policy.devpath[0] == '\0') { /* awaken all devices */ @@ -1016,13 +1015,13 @@ static void handle_request(struct subscriber_t *sub, (void)snprintf(reply, replylen, "{\"class\":\"ERROR\",\"message\":\"Do nuch device as %s\"}\r\n", sub->policy.devpath); - gpsd_report(LOG_ERROR, "ERROR response: %s", reply); + gpsd_report(LOG_ERROR, "ERROR response: %s\n", reply); goto bailout; } else if (!awaken(devp)) (void)snprintf(reply, replylen, "{\"class\":\"ERROR\",\"message\":\"Can't assign %s\"}\r\n", sub->policy.devpath); - gpsd_report(LOG_ERROR, "ERROR response: %s", reply); + gpsd_report(LOG_ERROR, "ERROR response: %s\n", reply); goto bailout; } } @@ -1056,7 +1055,7 @@ static void handle_request(struct subscriber_t *sub, (void)snprintf(reply, replylen, "{\"class\":\"ERROR\",\"message\":\"Invalid DEVICE: %s\"}\r\n", json_error_string(status)); - gpsd_report(LOG_ERROR, "ERROR response: %s", reply); + gpsd_report(LOG_ERROR, "ERROR response: %s\n", reply); goto bailout; } else { if (devconf.path[0] != '\0') { @@ -1065,7 +1064,7 @@ static void handle_request(struct subscriber_t *sub, (void)snprintf(reply, replylen, "{\"class\":\"ERROR\",\"message\":\"Can't open %s.\"}\r\n", devconf.path); - gpsd_report(LOG_ERROR, "ERROR response: %s", reply); + gpsd_report(LOG_ERROR, "ERROR response: %s\n", reply); goto bailout; } } else { @@ -1080,13 +1079,13 @@ static void handle_request(struct subscriber_t *sub, (void)strlcat(reply, "{\"class\":\"ERROR\",\"message\":\"Can't perform DEVICE configuration, no devices attached.\"}\r\n", replylen); - gpsd_report(LOG_ERROR, "ERROR response: %s", reply); + gpsd_report(LOG_ERROR, "ERROR response: %s\n", reply); goto bailout; } else if (devcount > 1) { (void)snprintf(reply + strlen(reply), replylen - strlen(reply), "{\"class\":\"ERROR\",\"message\":\"No path specified in DEVICE, but multiple devices are attached.\"}\r\n"); - gpsd_report(LOG_ERROR, "ERROR response: %s", reply); + gpsd_report(LOG_ERROR, "ERROR response: %s\n", reply); goto bailout; } /* we should have exactly one device now */ @@ -1204,7 +1203,7 @@ static void handle_request(struct subscriber_t *sub, (void)snprintf(reply, replylen, "{\"class\":\"ERROR\",\"message\":\"Unrecognized request '%.*s'\"}\r\n", (int)(errend - buf), buf); - gpsd_report(LOG_ERROR, "ERROR response: %s", reply); + gpsd_report(LOG_ERROR, "ERROR response: %s\n", reply); buf += strlen(buf); } bailout: @@ -1792,13 +1791,13 @@ int main(int argc, char *argv[]) gpsd_maskdump(device->gpsdata.set)); if (report_fix) { nmea_tpv_dump(device, buf3, sizeof(buf3)); - gpsd_report(LOG_IO, "<= GPS (binary1) %s: %s", + gpsd_report(LOG_IO, "<= GPS (binary1) %s: %s\n", device->gpsdata.dev.path, buf3); (void)throttled_write(sub, buf3, strlen(buf3)); } else if ((changed & SATELLITE_IS) != 0) { nmea_sky_dump(device, buf3, sizeof(buf3)); - gpsd_report(LOG_IO, "<= GPS (binary2) %s: %s", + gpsd_report(LOG_IO, "<= GPS (binary2) %s: %s\n", device->gpsdata.dev.path, buf3); (void)throttled_write(sub, buf3, strlen(buf3)); @@ -1903,7 +1902,7 @@ int main(int argc, char *argv[]) buf[buflen++] = '\n'; buf[buflen] = '\0'; gpsd_report(LOG_IO, - "<= client(%d): %s", sub_index(sub), buf); + "<= client(%d): %s\n", sub_index(sub), buf); /* * When a command comes in, update subscriber.active to diff --git a/libgpsd_core.c b/libgpsd_core.c index 95a4370c..52f96d10 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -295,7 +295,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) } /*@ -boolint @*/ if (NULL != log) { - gpsd_report(LOG_RAW, "%s", log); + gpsd_report(LOG_RAW, "%s\n", log); } if (0 != ok) { (void)ntpshm_pps(session, &tv); diff --git a/net_dgpsip.c b/net_dgpsip.c index 0217c0bb..92eb5a28 100644 --- a/net_dgpsip.c +++ b/net_dgpsip.c @@ -87,9 +87,9 @@ void dgpsip_report(struct gps_device_t *session) session->gpsdata.fix.altitude); if (write(session->context->dsock, buf, strlen(buf)) == (ssize_t) strlen(buf)) - gpsd_report(LOG_IO, "=> dgps %s", buf); + gpsd_report(LOG_IO, "=> dgps %s\n", buf); else - gpsd_report(LOG_IO, "write to dgps FAILED"); + gpsd_report(LOG_IO, "write to dgps FAILED\n"); } } } diff --git a/net_ntrip.c b/net_ntrip.c index 100fe012..37ba1ac0 100644 --- a/net_ntrip.c +++ b/net_ntrip.c @@ -511,9 +511,9 @@ void ntrip_report(struct gps_device_t *session) gpsd_position_fix_dump(session, buf, sizeof(buf)); if (write(session->context->dsock, buf, strlen(buf)) == (ssize_t) strlen(buf)) - gpsd_report(LOG_IO, "=> dgps %s", buf); + gpsd_report(LOG_IO, "=> dgps %s\n", buf); else - gpsd_report(LOG_IO, "ntrip report write failed"); + gpsd_report(LOG_IO, "ntrip report write failed\n"); } } } |