diff options
| author | sin | 2015-02-28 14:52:09 +0000 |
|---|---|---|
| committer | sin | 2015-02-28 14:52:09 +0000 |
| commit | 2f0e3f574f74e85f2a38aebc141f3d6fbc380910 (patch) | |
| tree | bb8922f3f63f1cfafa6d1987f51c7d3663dae701 | |
| parent | 2ea31ca96f0e836b7477a52b3c15f313f69c1098 (diff) | |
Don't include stddef.h from poll.h
| -rw-r--r-- | include/poll.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/poll.h b/include/poll.h index 54fc4ab..cbc78fd 100644 --- a/include/poll.h +++ b/include/poll.h | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | #ifndef FORTIFY_POLL_H_ | 1 | #ifndef FORTIFY_POLL_H_ |
| 2 | #define FORTIFY_POLL_H_ | 2 | #define FORTIFY_POLL_H_ |
| 3 | 3 | ||
| 4 | #include_next <stddef.h> | ||
| 5 | #include_next <poll.h> | 4 | #include_next <poll.h> |
| 6 | 5 | ||
| 7 | #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 | 6 | #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 |
| @@ -10,9 +9,9 @@ static inline __attribute__ ((always_inline)) | |||
| 10 | int | 9 | int |
| 11 | __fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout) | 10 | __fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout) |
| 12 | { | 11 | { |
| 13 | size_t bos = __builtin_object_size(fds, 0); | ||
| 14 | 12 | ||
| 15 | if (bos != -1 && nfds > bos / sizeof(struct pollfd)) | 13 | if (__builtin_object_size(fds, 0) != -1 && |
| 14 | nfds > __builtin_object_size(fds, 0) / sizeof(struct pollfd)) | ||
| 16 | __builtin_trap(); | 15 | __builtin_trap(); |
| 17 | return poll(fds, nfds, timeout); | 16 | return poll(fds, nfds, timeout); |
| 18 | } | 17 | } |
