Commit ae9871e7 authored by Alessandro Rubini's avatar Alessandro Rubini

arch-unix: use strerror for receive errors

Also, prepare for drop support (i.e., no message for the special error code)
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent d7091dd8
......@@ -113,12 +113,19 @@ void unix_main_loop(struct pp_globals *ppg)
PP_MAX_FRAME_LENGTH - 4,
&ppi->last_rcv_time);
if (i == -2) {
continue; /* dropped */
}
if (i == -1) {
pp_diag(ppi, frames, 1,
"Receive Error %i: %s\n",
errno, strerror(errno));
continue;
}
if (i < PP_MINIMUM_LENGTH) {
pp_diag(ppi, frames, 1,
"Error or short frame: "
"%d < %d\n", i,
PP_MINIMUM_LENGTH
);
"Short frame: %d < %d\n", i,
PP_MINIMUM_LENGTH);
continue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment