summary refs log tree commit diff
path: root/rvnit.c
diff options
context:
space:
mode:
Diffstat (limited to 'rvnit.c')
-rw-r--r--rvnit.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/rvnit.c b/rvnit.c
index 70dace8..fa15889 100644
--- a/rvnit.c
+++ b/rvnit.c
@@ -356,6 +356,16 @@ logger_loop(void* ignored)
 				continue;
 			}
 
+			if (rd < (int)sizeof buf && buf[rd - 1] != '\n') {
+				// sometimes processes use multiple write calls
+				// for one line, give them 25msec to do try to
+				// get the whole line.
+				nanosleep(&(struct timespec){0, 25000000}, 0);
+				ssize_t rd2 = read(fds[j].fd, buf + rd, sizeof buf - rd);
+				if (rd2 > 0)
+					rd += rd2;
+			}
+
 			const char *sv = "<unknown>";
 			long pid = -1;