Skip to content

Commit 49a3b54

Browse files
committed
Mark aproc as done prior to callback
1 parent 2939ec6 commit 49a3b54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,8 @@ int aproc_drain_all(aproc_t *aprocs, int *ttyfd) {
762762
if (FD_ISSET(aproc->rfd, &readfds)) {
763763
nbytes = read(aproc->rfd, &buf, 1024);
764764
buf[nbytes] = '\0';
765-
aproc->callback(aproc, buf, nbytes);
766765
if (nbytes == 0) aproc->is_done = 1;
766+
aproc->callback(aproc, buf, nbytes);
767767
}
768768
// Destroy on eof.
769769
// Not sure if ferror and feof have any effect here given we're not

0 commit comments

Comments
 (0)