rc: fix double close() in addenv()

This commit is contained in:
cinap_lenrek 2016-05-16 18:03:57 +02:00
parent b6b5fd6da7
commit ce7f7d3ab9

View file

@ -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);
}
}
}