summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/zlog_live.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/zlog_live.c b/lib/zlog_live.c
index eeedf5c42..7abf1a801 100644
--- a/lib/zlog_live.c
+++ b/lib/zlog_live.c
@@ -22,6 +22,7 @@
#include "frrcu.h"
#include "zlog.h"
#include "printfrr.h"
+#include "network.h"
DEFINE_MTYPE_STATIC(LOG, LOG_LIVE, "log vtysh live target");
@@ -109,6 +110,8 @@ static void zlog_live(struct zlog_target *zt, struct zlog_msg *msgs[],
for (size_t msgpos = 0; msgpos < msgtotal; msgpos += sent) {
sent = sendmmsg(fd, mmhs + msgpos, msgtotal - msgpos, 0);
+ if (sent <= 0 && (errno == EAGAIN || errno == EWOULDBLOCK))
+ break;
if (sent <= 0)
goto out_err;
}
@@ -195,6 +198,7 @@ void zlog_live_open(struct zlog_live_cfg *cfg, int prio_min, int *other_fd)
zte = container_of(zt, struct zlt_live, zt);
cfg->target = zte;
+ set_nonblocking(sockets[0]);
zte->fd = sockets[0];
zte->zt.prio_min = prio_min;
zte->zt.logfn = zlog_live;