Skip to content

Commit

Permalink
several more error log lines fixed to include error string
Browse files Browse the repository at this point in the history
  • Loading branch information
f34rdotcom committed Feb 7, 2014
1 parent 2d0d828 commit 3942a66
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ser2sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ int init_serial_fd(char * szPortPath)

if (fd < 0)
{
log_message(STREAM_MAIN, MSG_BAD, "Error can not open com port at %s errno: %i\n", szPortPath, errno);
log_message(STREAM_MAIN, MSG_BAD, "Error can not open com port at %s errno: %i '%s'\n", szPortPath, errno, strerror(errno));
return fd;
}

Expand Down Expand Up @@ -891,7 +891,7 @@ void poll_serial_port()
{
if (ioctl(my_fds[n].fd, TIOCMGET, &tmp) < 0)
{
log_message(STREAM_MAIN, MSG_WARN, "Serial disconnected on check. errno: %i\n",errno);
log_message(STREAM_MAIN, MSG_WARN, "Serial disconnected on check. errno: %i '%s'\n", errno, strerror(errno));
clear_serial(n);
}
/* currently only 1 serial port so we are done */
Expand Down Expand Up @@ -1140,8 +1140,8 @@ BOOL poll_read_fdset(fd_set *read_fdset)
if (errno != EAGAIN)
{
log_message(STREAM_MAIN, MSG_WARN,
"Serial disconnected on read. errno: %i\n",
errno);
"Serial disconnected on read. errno: %i '%s'\n",
errno, strerror(errno));
clear_serial(n);
}
}
Expand All @@ -1163,8 +1163,8 @@ BOOL poll_read_fdset(fd_set *read_fdset)
}
if (received == 0)
{
log_message(STREAM_MAIN, MSG_WARN, "Closing socket fd slot %i errno: %i\n",n,
errno);
log_message(STREAM_MAIN, MSG_WARN, "Closing socket fd slot %i errno: %i '%s'\n", n,
errno, strerror(errno));
cleanup_fd(n);
}
else
Expand All @@ -1174,8 +1174,8 @@ BOOL poll_read_fdset(fd_set *read_fdset)
if (errno == EAGAIN || errno == EINTR)
continue;
log_message(STREAM_MAIN, MSG_WARN,
"Closing socket errno: %i\n",
errno);
"Closing socket errno: %i '%s'\n",
errno, strerror(errno));
cleanup_fd(n);
}
else
Expand Down Expand Up @@ -1288,8 +1288,8 @@ BOOL poll_write_fdset(fd_set *write_fdset)
if (errno != EAGAIN)
{
log_message(STREAM_MAIN, MSG_BAD,
"Serial disconnected on write. errno: %i\n",
errno);
"Serial disconnected on write. errno: %i '%s'\n",
errno, strerror(errno));
clear_serial(n);
}
}
Expand Down Expand Up @@ -1383,7 +1383,7 @@ void listen_loop()
n = select(FD_SETSIZE, &read_fdset, &write_fdset, &except_fdset, &wait);
if (n == -1)
{
log_message(STREAM_MAIN, MSG_BAD, "An error occured during select() errno: %i\n",errno);
log_message(STREAM_MAIN, MSG_BAD, "An error occured during select() errno: %i '%s'\n", errno, strerror(errno));
continue;
}

Expand Down

0 comments on commit 3942a66

Please sign in to comment.