Deleted Added
full compact
37c37
< __FBSDID("$FreeBSD: head/lib/libc/stdio/freopen.c 165903 2007-01-09 00:28:16Z imp $");
---
> __FBSDID("$FreeBSD: head/lib/libc/stdio/freopen.c 176628 2008-02-27 19:02:02Z jhb $");
205a206,219
> /*
> * File descriptors are a full int, but _file is only a short.
> * If we get a valid file descriptor that is greater than
> * SHRT_MAX, then the fd will get sign-extended into an
> * invalid file descriptor. Handle this case by failing the
> * open.
> */
> if (f > SHRT_MAX) {
> fp->_flags = 0; /* set it free */
> FUNLOCKFILE(fp);
> errno = EMFILE;
> return (NULL);
> }
>