]> git.lizzy.rs Git - plan9front.git/commitdiff
acme: fix fd checks - initialize Window.rdselfd to -1 not 0
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sat, 20 Oct 2018 21:57:50 +0000 (23:57 +0200)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sat, 20 Oct 2018 21:57:50 +0000 (23:57 +0200)
sys/src/cmd/acme/cols.c
sys/src/cmd/acme/xfid.c

index 386233d30ddef14c98f948bbd0ffb14dad325526..a5e0fbd2874c6e3223b416e7b2c5f78923cb43b8 100644 (file)
@@ -84,6 +84,7 @@ coladd(Column *c, Window *w, Window *clone, int y)
        }
        if(w == nil){
                w = emalloc(sizeof(Window));
+               w->rdselfd = -1;
                w->col = c;
                draw(screen, r, textcols[BACK], nil, ZP);
                wininit(w, clone, r);
index 38db4acd051285148524a6c9a056e61a1d5394c5..2a8e17bdb53f89207905ea8bdde91323dd4714a2 100644 (file)
@@ -236,7 +236,7 @@ xfidclose(Xfid *x)
                        break;
                case QWrdsel:
                        close(w->rdselfd);
-                       w->rdselfd = 0;
+                       w->rdselfd = -1;
                        break;
                case QWwrsel:
                        w->nomark = FALSE;