diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2008-07-13 10:12:17 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2008-07-13 10:12:17 +0000 |
commit | cebe4d4c695c75d686a387b57e3d19bae5ccafb9 (patch) | |
tree | 055790d3e3e59d84d3d8c6ae01f28c82efcf16d5 /packet.c | |
parent | b683a8eb129a1ee677618fe8197d610eec769c64 (diff) | |
download | gpsd-cebe4d4c695c75d686a387b57e3d19bae5ccafb9.tar.gz |
Improved debugging message.
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1264,22 +1264,25 @@ ssize_t packet_get(int fd, struct gps_packet_t *lexer) /*@ -modobserver @*/ recvd = read(fd, lexer->inbuffer+lexer->inbuflen, sizeof(lexer->inbuffer)-(lexer->inbuflen)); -#ifdef STATE_DEBUG - gpsd_report(LOG_RAW+1, "%d raw bytes read from %d: %s\n", - recvd, fd, gpsd_hexdump(lexer->inbuffer+lexer->inbuflen, recvd)); -#endif /* STATE_DEBUG */ /*@ +modobserver @*/ if (recvd == -1) { if ((errno == EAGAIN) || (errno == EINTR)) { +#ifdef STATE_DEBUG + gpsd_report(LOG_RAW+2, "no bytes ready\n"); +#endif /* STATE_DEBUG */ return 0; } else { #ifdef STATE_DEBUG - gpsd_report(LOG_RAW+1, "errno: %s\n", strerror(errno)); + gpsd_report(LOG_RAW+2, "errno: %s\n", strerror(errno)); #endif /* STATE_DEBUG */ return EOF_PACKET; } } +#ifdef STATE_DEBUG + gpsd_report(LOG_RAW+2, "%d raw bytes read from %d: %s\n", + recvd, fd, gpsd_hexdump(lexer->inbuffer+lexer->inbuflen, (size_t)recvd)); +#endif /* STATE_DEBUG */ if (recvd == 0) return 0; return packet_parse(lexer, (size_t)recvd); |