~foura/libacme

0f90115ff87e5866726c8c7d615f8293c39f21c5 — james palmer 5 months ago f562678
aeventproc: malloc the Biobuf, it was overflowing the stack
1 files changed, 6 insertions(+), 4 deletions(-)

M event.c
M event.c => event.c +6 -4
@@ 73,16 73,18 @@ aeventproc(void *aux)
{
	AWin *w;
	Channel *c;
	Biobuf bio;
	Biobuf *bio;
	AEvent ev;
	
	w = aux;
	c = w->eventc;
	Binit(&bio, w->eventfd, OREAD);
	bio = mallocz(sizeof(Biobuf), 1);
	Binit(bio, w->eventfd, OREAD);
	
	while(aeventnext(&bio, &ev)) {
	while(aeventnext(bio, &ev)) {
		if(send(c, &ev) < 0) {
			Bterm(&bio);
			Bterm(bio);
			free(bio);
			exits(nil);
		}
	}