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,13 +273,11 @@ addenv(var *v)
|
||||||
if((f = Creat(envname))<0)
|
if((f = Creat(envname))<0)
|
||||||
pfmt(err, "rc: can't open %s: %r\n", envname);
|
pfmt(err, "rc: can't open %s: %r\n", envname);
|
||||||
else{
|
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);
|
pfmt(fd, "fn %q %s\n", v->name, v->fn[v->pc-1].s);
|
||||||
closeio(fd);
|
closeio(fd);
|
||||||
}
|
}
|
||||||
close(f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue