From 4b962c9e859de23b461d61f860dbd3f21311e83a Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Sun, 12 Apr 2020 17:42:35 -0300 Subject: linux: Simplify opendir buffer allocation The fallback allocation is removed, so the possible size constraint should be analyzed just once; __alloc_dir assumes that 'statp' argument is non-null, and the max_buffer_size move to close its used. Checked on x86_64-linux-gnu and i686-linux-gnu. --- include/dirent.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/dirent.h b/include/dirent.h index 2b1cdcf8bd..fdf4c4a2f1 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -48,7 +48,8 @@ extern int __versionsort64 (const struct dirent64 **a, const struct dirent64 **b) __attribute_pure__; extern DIR *__alloc_dir (int fd, bool close_fd, int flags, - const struct stat64 *statp) attribute_hidden; + const struct stat64 *statp) + __nonnull (4) attribute_hidden; extern __typeof (rewinddir) __rewinddir; extern __typeof (seekdir) __seekdir; extern __typeof (dirfd) __dirfd; -- cgit v1.2.3