rc: fix double close() in addenv()
This commit is contained in:
parent
b6b5fd6da7
commit
ce7f7d3ab9
1 changed files with 3 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue