Only activate __EXT1_VISIBLE block when using sys/errno.h in userspace.

The prerequisite for '#if __EXT1_VISIBLE' functionality is the
inclusion of sys/cdefs.h.  errno.h only auto-includes the header for
non-kernel environment, and EXT1 block only useful for non-kernel as
well.

Reported by:	lwhsu
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
This commit is contained in:
kib 2017-03-30 06:24:30 +00:00
parent 9a65937e29
commit f6b29b3425

View File

@ -193,6 +193,7 @@ __END_DECLS
#define ERELOOKUP (-5) /* retry the directory lookup */
#endif
#ifndef _KERNEL
#if __EXT1_VISIBLE
/* ISO/IEC 9899:2011 K.3.2.2 */
#ifndef _ERRNO_T_DEFINED
@ -200,5 +201,6 @@ __END_DECLS
typedef int errno_t;
#endif
#endif /* __EXT1_VISIBLE */
#endif
#endif