sh: Reduce code duplication: use setinputfile instead of open/setinputfd
combination. MFC after: 2 weeks
This commit is contained in:
parent
86dcb2ee7f
commit
d902a66b99
@ -266,14 +266,7 @@ read_profile(char *name)
|
||||
void
|
||||
readcmdfile(const char *name)
|
||||
{
|
||||
int fd;
|
||||
|
||||
INTOFF;
|
||||
if ((fd = open(name, O_RDONLY)) >= 0)
|
||||
setinputfd(fd, 1);
|
||||
else
|
||||
error("cannot open %s: %s", name, strerror(errno));
|
||||
INTON;
|
||||
setinputfile(name, 1);
|
||||
cmdloop(0);
|
||||
popfile();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user