diff --git a/sys/src/cmd/rc/plan9.c b/sys/src/cmd/rc/plan9.c index 412e6957d..a9dcdddfe 100644 --- a/sys/src/cmd/rc/plan9.c +++ b/sys/src/cmd/rc/plan9.c @@ -273,12 +273,10 @@ addenv(var *v) if((f = Creat(envname))<0) pfmt(err, "rc: can't open %s: %r\n", envname); else{ - if(v->fn){ - fd = openfd(f); + fd = openfd(f); + if(v->fn) pfmt(fd, "fn %q %s\n", v->name, v->fn[v->pc-1].s); - closeio(fd); - } - close(f); + closeio(fd); } } }