The below patch adds a missing return statement to avoid a double close() on a file descriptor and printing of conflicting messages where one says `can't write...` followed by a `wrote ...` message. Plumb the following for more context: ∙ /sys/src/cmd/tweak.c:/^twrite ∙ /sys/src/cmd/tweak.c:1730,1739 From: Igor Böhm Date: Wed, 06 Oct 2021 13:37:39 +0000 Subject: [PATCH] tweak: add missing return to fix double close(…) on file descriptor… … and avoid printing conflicting messages. --- diff 6ebb8b9e357944cc29ae3fafc0900ee3e325ed39 f9a20f83ad671a6404c42cc2bdfd4c9b1abceabc --- a/sys/src/cmd/tweak.c Sun Oct 3 17:58:58 2021 +++ b/sys/src/cmd/tweak.c Wed Oct 6 15:37:39 2021 @@ -1731,6 +1731,7 @@ if(writeimage(fd, t->b, 0)<0 || (t->s && writesubfont(fd, t->s)<0)){ close(fd); mesg("can't write %s: %r", t->name); + return; } t->mod = 0; close(fd); Cheers, Igor