summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_fpm.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_fpm.c')
-rw-r--r--zebra/zebra_fpm.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c
index 0d0a2cb3b..a6e0882ff 100644
--- a/zebra/zebra_fpm.c
+++ b/zebra/zebra_fpm.c
@@ -713,7 +713,15 @@ static int zfpm_read_cb(struct thread *thread)
nbyte = stream_read_try(ibuf, zfpm_g->sock,
FPM_MSG_HDR_LEN - already);
if (nbyte == 0 || nbyte == -1) {
- zfpm_connection_down("closed socket in read");
+ if (nbyte == -1) {
+ char buffer[1024];
+
+ sprintf(buffer, "closed socket in read(%d): %s",
+ errno, safe_strerror(errno));
+ zfpm_connection_down(buffer);
+ }
+ else
+ zfpm_connection_down("closed socket in read");
return 0;
}
@@ -743,7 +751,15 @@ static int zfpm_read_cb(struct thread *thread)
nbyte = stream_read_try(ibuf, zfpm_g->sock, msg_len - already);
if (nbyte == 0 || nbyte == -1) {
- zfpm_connection_down("failed to read message");
+ if (nbyte == -1) {
+ char buffer[1024];
+
+ sprintf(buffer, "failed to read message(%d) %s",
+ errno, safe_strerror(errno));
+ zfpm_connection_down(buffer);
+ }
+ else
+ zfpm_connection_down("failed to read message");
return 0;
}