~foura/libacme

d649586e750604585369429b82963dbed434307d — james palmer 6 months ago e29aea8
fix awinclose
1 files changed, 10 insertions(+), 4 deletions(-)

M window.c
M window.c => window.c +10 -4
@@ 40,15 40,15 @@ awincreate(void)
	char buf[12];
	
	w = mallocz(sizeof(AWin), 1);
	w->ctlfd = open("/mnt/wsys/new/ctl", ORDWR|OCEXEC);
	w->ctlfd = open("/mnt/wsys/new/ctl", ORDWR);
	if(w->ctlfd < 0)
		sysfatal("open ctl: %r");
	if(read(w->ctlfd, buf, sizeof(buf)) != sizeof(buf))
		sysfatal("read ctl: %r");
	
	w->id = atoi(buf);
	w->addrfd = awinfsopen(w, "addr", ORDWR);
	w->datafd = awinfsopen(w, "data", ORDWR);
	w->addrfd = -1;
	w->datafd = -1;

	w->next = awins;
	awins = w;


@@ 110,8 110,14 @@ awinctl(AWin *w, char *fmt, ...)
void
awinclear(AWin *w)
{
	w->addrfd = awinfsopen(w, "addr", OWRITE);
	w->datafd = awinfsopen(w, "data", OWRITE);
	
	fprint(w->addrfd, ",");
	fprint(w->datafd, "");
	write(w->datafd, "", 0);
	
	close(w->datafd);
	close(w->addrfd);
}

int