diff options
author | pfg <pfg@FreeBSD.org> | 2014-07-20 20:14:15 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2014-07-20 20:14:15 +0000 |
commit | 30b6369746e5c67ea575ac72604b40bfdd81e6d7 (patch) | |
tree | 5a14a51dbb0a3a9eb079e337a7dafb18cdd314e5 /lib/libc | |
parent | 4f16edc0eea6d756d24b997c4455a37f54a64a0c (diff) | |
download | FreeBSD-src-30b6369746e5c67ea575ac72604b40bfdd81e6d7.zip FreeBSD-src-30b6369746e5c67ea575ac72604b40bfdd81e6d7.tar.gz |
Use a correct errno in freopen.
Use EBADF instead of EINVAL when working around incorrect O_ACCMODE.
Phabric: D442
Obtained from: Apple Inc. (Libc 997.90.3)
Reviewed by: jilles
MFC after: 1 week
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdio/freopen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/stdio/freopen.c b/lib/libc/stdio/freopen.c index 0ff83bf..28b54f8 100644 --- a/lib/libc/stdio/freopen.c +++ b/lib/libc/stdio/freopen.c @@ -97,7 +97,7 @@ freopen(const char * __restrict file, const char * __restrict mode, (dflags & (O_ACCMODE | O_EXEC)) != (oflags & O_ACCMODE)) { fclose(fp); FUNLOCKFILE(fp); - errno = EINVAL; + errno = EBADF; return (NULL); } if (fp->_flags & __SWR) |