run_chroot: always clear script output buffer
If the script output does not end in a newline there could still be data in the buffer after the poll loop. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
34bbe4cf7b
commit
dfa4dcb16d
1 changed files with 6 additions and 0 deletions
|
@ -681,6 +681,12 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[],
|
||||||
STOP_POLLING(parent2child);
|
STOP_POLLING(parent2child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* process anything left in the input buffer */
|
||||||
|
if(ilen) {
|
||||||
|
/* buffer would have already been flushed if it had a newline */
|
||||||
|
strcpy(ibuf + ilen, "\n");
|
||||||
|
_alpm_chroot_process_output(handle, ibuf);
|
||||||
|
}
|
||||||
|
|
||||||
#undef STOP_POLLING
|
#undef STOP_POLLING
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue