diff options
author | jilles <jilles@FreeBSD.org> | 2012-09-14 15:22:15 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2012-09-14 15:22:15 +0000 |
commit | 126621e68f9e6210c80509dd2a999d93f52d0da3 (patch) | |
tree | 1ad5d532a2e9e096d3c2149663010a39ccf41f82 | |
parent | c3a787ae197e366fb45420eeef241208062b040a (diff) | |
download | FreeBSD-src-126621e68f9e6210c80509dd2a999d93f52d0da3.zip FreeBSD-src-126621e68f9e6210c80509dd2a999d93f52d0da3.tar.gz |
sh: Reduce code duplication: use setinputfile instead of open/setinputfd
combination.
MFC after: 2 weeks
-rw-r--r-- | bin/sh/main.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/bin/sh/main.c b/bin/sh/main.c index 5eb12e0..b93f04e 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -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(); } |