summaryrefslogtreecommitdiff
path: root/serial.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2016-05-16 19:37:59 -0700
committerGary E. Miller <gem@rellim.com>2016-05-16 19:37:59 -0700
commit6394b4ebd980c92e02748b2285ba097aae42375c (patch)
treec464d0b5440bc1675e0d0a7beb033f99be5fe82c /serial.c
parentc3769a68be64894a7d87beb6a04c515d6efb21a6 (diff)
downloadgpsd-6394b4ebd980c92e02748b2285ba097aae42375c.tar.gz
Prefix logs from serial.c with SER:
This makes it easy to trace the serial.c code: gpsd -nND 8 /dev/ttyS0 |& fgrep SER:
Diffstat (limited to 'serial.c')
-rw-r--r--serial.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/serial.c b/serial.c
index cce4371d..6fd7a52b 100644
--- a/serial.c
+++ b/serial.c
@@ -244,7 +244,7 @@ bool gpsd_set_raw(struct gps_device_t * session)
(void)cfmakeraw(&session->ttyset);
if (tcsetattr(session->gpsdata.gps_fd, TCIOFLUSH, &session->ttyset) == -1) {
gpsd_log(&session->context->errout, LOG_ERROR,
- "error changing port attributes: %s\n", strerror(errno));
+ "SER: error changing port attributes: %s\n", strerror(errno));
return false;
}
@@ -375,7 +375,7 @@ void gpsd_set_speed(struct gps_device_t *session,
(void)tcflush(session->gpsdata.gps_fd, TCIOFLUSH);
}
gpsd_log(&session->context->errout, LOG_INF,
- "speed %lu, %d%c%d\n",
+ "SER: speed %lu, %d%c%d\n",
(unsigned long)gpsd_get_speed(session), 9 - stopbits, parity,
stopbits);
@@ -431,11 +431,11 @@ int gpsd_serial_open(struct gps_device_t *session)
|| (session->sourcetype <= source_blockdev)) {
mode = (mode_t) O_RDONLY;
gpsd_log(&session->context->errout, LOG_INF,
- "opening read-only GPS data source type %d and at '%s'\n",
+ "SER: opening read-only GPS data source type %d and at '%s'\n",
(int)session->sourcetype, session->gpsdata.dev.path);
} else {
gpsd_log(&session->context->errout, LOG_INF,
- "opening GPS data source type %d at '%s'\n",
+ "SER: opening GPS data source type %d at '%s'\n",
(int)session->sourcetype, session->gpsdata.dev.path);
}
#ifdef ENABLE_BLUEZ
@@ -451,17 +451,17 @@ int gpsd_serial_open(struct gps_device_t *session)
if (errno != EINPROGRESS && errno != EAGAIN) {
(void)close(session->gpsdata.gps_fd);
gpsd_log(&session->context->errout, LOG_ERROR,
- "bluetooth socket connect failed: %s\n",
+ "SER: bluetooth socket connect failed: %s\n",
strerror(errno));
return UNALLOCATED_FD;
}
gpsd_log(&session->context->errout, LOG_ERROR,
- "bluetooth socket connect in progress or again : %s\n",
+ "SER: bluetooth socket connect in progress or again : %s\n",
strerror(errno));
}
(void)fcntl(session->gpsdata.gps_fd, F_SETFL, (int)mode);
gpsd_log(&session->context->errout, LOG_PROG,
- "bluez device open success: %s %s\n",
+ "SER: bluez device open success: %s %s\n",
session->gpsdata.dev.path, strerror(errno));
} else
#endif /* BLUEZ */
@@ -473,20 +473,20 @@ int gpsd_serial_open(struct gps_device_t *session)
if ((session->gpsdata.gps_fd =
open(session->gpsdata.dev.path, (int)(mode | O_NONBLOCK | O_NOCTTY))) == -1) {
gpsd_log(&session->context->errout, LOG_ERROR,
- "device open of %s failed: %s - retrying read-only\n",
+ "SER: device open of %s failed: %s - retrying read-only\n",
session->gpsdata.dev.path,
strerror(errno));
if ((session->gpsdata.gps_fd =
open(session->gpsdata.dev.path, O_RDONLY | O_NONBLOCK | O_NOCTTY)) == -1) {
gpsd_log(&session->context->errout, LOG_ERROR,
- "read-only device open of %s failed: %s\n",
+ "SER: read-only device open of %s failed: %s\n",
session->gpsdata.dev.path,
strerror(errno));
return UNALLOCATED_FD;
}
gpsd_log(&session->context->errout, LOG_PROG,
- "file device open of %s succeeded: %s\n",
+ "SER: file device open of %s succeeded: %s\n",
session->gpsdata.dev.path,
strerror(errno));
}
@@ -519,7 +519,7 @@ int gpsd_serial_open(struct gps_device_t *session)
*/
if (fusercount(session->gpsdata.dev.path) > 1) {
gpsd_log(&session->context->errout, LOG_ERROR,
- "%s already opened by another process\n",
+ "SER: %s already opened by another process\n",
session->gpsdata.dev.path);
(void)close(session->gpsdata.gps_fd);
session->gpsdata.gps_fd = UNALLOCATED_FD;
@@ -593,7 +593,7 @@ int gpsd_serial_open(struct gps_device_t *session)
}
gpsd_log(&session->context->errout, LOG_SPIN,
- "open(%s) -> %d in gpsd_serial_open()\n",
+ "SER: open(%s) -> %d in gpsd_serial_open()\n",
session->gpsdata.dev.path, session->gpsdata.gps_fd);
return session->gpsdata.gps_fd;
}
@@ -613,7 +613,7 @@ ssize_t gpsd_serial_write(struct gps_device_t * session,
if (session->context->errout.debug >= LOG_IO) {
char scratchbuf[MAX_PACKET_LENGTH*2+1];
gpsd_log(&session->context->errout, LOG_IO,
- "=> GPS: %s%s\n",
+ "SER: => GPS: %s%s\n",
gpsd_packetdump(scratchbuf, sizeof(scratchbuf),
(char *)buf, len), ok ? "" : " FAILED");
}
@@ -699,7 +699,7 @@ void gpsd_close(struct gps_device_t *session)
#endif /* TIOCNXCL */
(void)tcdrain(session->gpsdata.gps_fd);
gpsd_log(&session->context->errout, LOG_SPIN,
- "close(%d) in gpsd_close(%s)\n",
+ "SER: close(%d) in gpsd_close(%s)\n",
session->gpsdata.gps_fd, session->gpsdata.dev.path);
(void)close(session->gpsdata.gps_fd);
session->gpsdata.gps_fd = -1;