diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2018-01-28 18:48:04 +0100 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2018-01-29 22:21:21 +0100 |
commit | 9a1793289b08339660985cb2baada60debc70bf2 (patch) | |
tree | a934b7ecc9cab380428be0eea4939083d3c57f4f /sysdeps/posix/pathconf.c | |
parent | e01e0ddc42e5909af0409d28bc4fd52ebfdbc7db (diff) | |
download | glibc-9a1793289b08339660985cb2baada60debc70bf2.tar.gz glibc-9a1793289b08339660985cb2baada60debc70bf2.tar.xz glibc-9a1793289b08339660985cb2baada60debc70bf2.zip |
Reject invalid definitions of _POSIX_CHOWN_RESTRICTED, _POSIX_NO_TRUNC, _POSIX_VDISABLE
POSIX requires that the constants _POSIX_CHOWN_RESTRICTED, _POSIX_NO_TRUNC, and _POSIX_VDISABLE are always defined to a value other than -1.
Diffstat (limited to 'sysdeps/posix/pathconf.c')
-rw-r--r-- | sysdeps/posix/pathconf.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/sysdeps/posix/pathconf.c b/sysdeps/posix/pathconf.c index 2059e55b4f..0f893ec1ba 100644 --- a/sysdeps/posix/pathconf.c +++ b/sysdeps/posix/pathconf.c @@ -101,25 +101,22 @@ __pathconf (const char *path, int name) #endif case _PC_CHOWN_RESTRICTED: -#ifdef _POSIX_CHOWN_RESTRICTED - return _POSIX_CHOWN_RESTRICTED; -#else - return -1; +#if _POSIX_CHOWN_RESTRICTED == -1 +# error "Invalid value for _POSIX_CHOWN_RESTRICTED" #endif + return _POSIX_CHOWN_RESTRICTED; case _PC_NO_TRUNC: -#ifdef _POSIX_NO_TRUNC - return _POSIX_NO_TRUNC; -#else - return -1; +#if _POSIX_NO_TRUNC == -1 +# error "Invalid value for _POSIX_NO_TRUNC" #endif + return _POSIX_NO_TRUNC; case _PC_VDISABLE: -#ifdef _POSIX_VDISABLE - return _POSIX_VDISABLE; -#else - return -1; +#if _POSIX_VDISABLE == -1 +# error "Invalid value for _POSIX_VDISABLE" #endif + return _POSIX_VDISABLE; case _PC_SYNC_IO: #ifdef _POSIX_SYNC_IO |