spawn: improve the pipe log reading
This commit is contained in:
parent
9cabe1ad55
commit
cee7147eef
1 changed files with 8 additions and 2 deletions
10
src/spawn.c
10
src/spawn.c
|
@ -90,9 +90,15 @@ spawn_pipe_read( th_pipe_t *p, char **_buf, int level )
|
|||
}
|
||||
buf[len + r] = '\0';
|
||||
tvhlog_hexdump("spawn", buf + len, r);
|
||||
while ((s = strchr(buf, '\n')) != NULL) {
|
||||
while (1) {
|
||||
s = buf;
|
||||
while (*s && *s != '\n' && *s != '\r')
|
||||
s++;
|
||||
if (*s == '\0')
|
||||
break;
|
||||
*s++ = '\0';
|
||||
tvhlog(level, "spawn", "%s", buf);
|
||||
if (buf[0])
|
||||
tvhlog(level, "spawn", "%s", buf);
|
||||
memmove(buf, s, strlen(s) + 1);
|
||||
}
|
||||
if (strlen(buf) == SPAWN_PIPE_READ_SIZE - 1) {
|
||||
|
|
Loading…
Add table
Reference in a new issue