Commit cc2c19c1 authored by Simon McVittie's avatar Simon McVittie

Modernize checks for dirfd/dd_fd

Part of a patch by Javier Jardón.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245Reviewed-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
parent ff04d739
......@@ -491,32 +491,34 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
AC_MSG_RESULT($broken_poll)
AC_MSG_CHECKING(for dirfd)
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <dirent.h>
],[
]], [[
DIR *dirp;
dirp = opendir(".");
dirfd(dirp);
closedir(dirp);
],
dbus_have_dirfd=yes, dbus_have_dirfd=no)
]])],
[dbus_have_dirfd=yes],
[dbus_have_dirfd=no])
AC_MSG_RESULT($dbus_have_dirfd)
if test "$dbus_have_dirfd" = yes; then
AC_DEFINE(HAVE_DIRFD,1,[Have dirfd function])
else
AC_MSG_CHECKING(for DIR *dirp->dd_fd)
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <dirent.h>
],[
]], [[
DIR *dirp;
int fd;
dirp = opendir(".");
fd = dirp->dd_fd;
closedir(dirp);
],
dbus_have_ddfd=yes, dbus_have_ddfd=no)
]])],
[dbus_have_ddfd=yes],
[dbus_have_ddfd=no])
AC_MSG_RESULT($dbus_have_ddfd)
if test "$dbus_have_ddfd" = yes; then
AC_DEFINE(HAVE_DDFD,1,[Have the ddfd member of DIR])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment