input.c (218306) | input.c (222684) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/bin/sh/input.c 218306 2011-02-04 22:47:55Z jilles $"); | 39__FBSDID("$FreeBSD: head/bin/sh/input.c 222684 2011-06-04 15:05:52Z jilles $"); |
40 41#include <stdio.h> /* defines BUFSIZ */ 42#include <fcntl.h> 43#include <errno.h> 44#include <unistd.h> 45#include <stdlib.h> 46#include <string.h> 47 --- 350 unchanged lines hidden (view full) --- 398void 399setinputfile(const char *fname, int push) 400{ 401 int fd; 402 int fd2; 403 404 INTOFF; 405 if ((fd = open(fname, O_RDONLY)) < 0) | 40 41#include <stdio.h> /* defines BUFSIZ */ 42#include <fcntl.h> 43#include <errno.h> 44#include <unistd.h> 45#include <stdlib.h> 46#include <string.h> 47 --- 350 unchanged lines hidden (view full) --- 398void 399setinputfile(const char *fname, int push) 400{ 401 int fd; 402 int fd2; 403 404 INTOFF; 405 if ((fd = open(fname, O_RDONLY)) < 0) |
406 error("Can't open %s: %s", fname, strerror(errno)); | 406 error("cannot open %s: %s", fname, strerror(errno)); |
407 if (fd < 10) { 408 fd2 = fcntl(fd, F_DUPFD, 10); 409 close(fd); 410 if (fd2 < 0) 411 error("Out of file descriptors"); 412 fd = fd2; 413 } 414 setinputfd(fd, push); --- 144 unchanged lines hidden --- | 407 if (fd < 10) { 408 fd2 = fcntl(fd, F_DUPFD, 10); 409 close(fd); 410 if (fd2 < 0) 411 error("Out of file descriptors"); 412 fd = fd2; 413 } 414 setinputfd(fd, push); --- 144 unchanged lines hidden --- |