Author: jilles Date: Fri Sep 14 15:22:15 2012 New Revision: 240505 URL: http://svn.freebsd.org/changeset/base/240505
Log: sh: Reduce code duplication: use setinputfile instead of open/setinputfd combination. MFC after: 2 weeks Modified: head/bin/sh/main.c Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Fri Sep 14 15:09:59 2012 (r240504) +++ head/bin/sh/main.c Fri Sep 14 15:22:15 2012 (r240505) @@ -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(); } _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"