X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/e49d720081d5875bc7d13121e919633293dedb8e..027428eb1d7524815d9b29f825033d7902258db5:/configure.in diff --git a/configure.in b/configure.in index b964efe7..09a3bd19 100644 --- a/configure.in +++ b/configure.in @@ -456,6 +456,31 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup strerror chown chmod mknod mkfifo \ strlcat strlcpy strtol mallinfo getgroups setgroups geteuid getegid \ open64 mkstemp64) +AC_CHECK_FUNCS(getpgrp tcgetpgrp) +if test $ac_cv_func_getpgrp = yes; then + AC_FUNC_GETPGRP +fi + +# Determine whether chown follows symlinks (it should). +AC_CACHE_CHECK([whether chown() dereferences symlinks],rsync_cv_chown_follows_symlink,[ + AC_TRY_RUN([ +#if HAVE_UNISTD_H +# include +#endif +#include +#include + main() { + char const *dangling_symlink = "conftest.dangle"; + unlink(dangling_symlink); + if (symlink("conftest.no-such", dangling_symlink) < 0) abort(); + if (chown(dangling_symlink, getuid(), getgid()) < 0 && errno == ENOENT) exit(0); + exit(1); + }], + rsync_cv_chown_follows_symlink=yes,rsync_cv_chown_follows_symlink=no,rsync_cv_chown_follows_symlink=yes)]) +if test $rsync_cv_chown_follows_symlink = no; then + AC_DEFINE(CHOWN_MODIFIES_SYMLINK, 1, [Define if chown modifies symlinks.]) +fi + AC_CACHE_CHECK([for working socketpair],rsync_cv_HAVE_SOCKETPAIR,[ AC_TRY_RUN([ #include