F_GETFD is both cheaper and easier to port, and otherwise has the same
effect here.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+ * elf_begin.c: Use F_GETFD rather than F_GETFL.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
* libelf.h: Define macros for various function attributes and use
them.
if (ref != NULL)
/* Make sure the descriptor is not suddenly going away. */
rwlock_rdlock (ref->lock);
- else if (unlikely (fcntl (fildes, F_GETFL) == -1 && errno == EBADF))
+ else if (unlikely (fcntl (fildes, F_GETFD) == -1 && errno == EBADF))
{
/* We cannot do anything productive without a file descriptor. */
__libelf_seterrno (ELF_E_INVALID_FILE);