changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: acme: fix fd checks - initialize Window.rdselfd to -1 not 0

changeset 6836: d1aca307a09b
parent 6835: 0b8c924d2d71
child 6837: 8773a350600f
child 6838: df82b64341f1
author: cinap_lenrek@felloff.net
date: Sat, 20 Oct 2018 23:57:50 +0200
files: sys/src/cmd/acme/cols.c sys/src/cmd/acme/xfid.c
description: acme: fix fd checks - initialize Window.rdselfd to -1 not 0
     1.1--- a/sys/src/cmd/acme/cols.c
     1.2+++ b/sys/src/cmd/acme/cols.c
     1.3@@ -84,6 +84,7 @@ coladd(Column *c, Window *w, Window *clo
     1.4 	}
     1.5 	if(w == nil){
     1.6 		w = emalloc(sizeof(Window));
     1.7+		w->rdselfd = -1;
     1.8 		w->col = c;
     1.9 		draw(screen, r, textcols[BACK], nil, ZP);
    1.10 		wininit(w, clone, r);
     2.1--- a/sys/src/cmd/acme/xfid.c
     2.2+++ b/sys/src/cmd/acme/xfid.c
     2.3@@ -236,7 +236,7 @@ xfidclose(Xfid *x)
     2.4 			break;
     2.5 		case QWrdsel:
     2.6 			close(w->rdselfd);
     2.7-			w->rdselfd = 0;
     2.8+			w->rdselfd = -1;
     2.9 			break;
    2.10 		case QWwrsel:
    2.11 			w->nomark = FALSE;