-dnl $Id: configure.in,v 1.214 2009-04-05 07:22:06 franklahm Exp $
+dnl $Id: configure.in,v 1.215 2009-04-10 11:21:18 franklahm Exp $
dnl configure.in for netatalk
AC_INIT(etc/afpd/main.c)
AC_FUNC_UTIME_NULL
AC_FUNC_WAIT3
AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul strchr memcpy)
-AC_CHECK_FUNCS(backtrace_symbols)
-AC_CHECK_FUNCS(setlocale nl_langinfo)
+AC_CHECK_FUNCS(backtrace_symbols setlocale nl_langinfo)
AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
-AC_CHECK_FUNCS(strlcpy strlcat setlinebuf gethostid)
+AC_CHECK_FUNCS(strlcpy strlcat setlinebuf gethostid dirfd)
AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
AC_CACHE_SAVE
/*
- * $Id: directory.c,v 1.95 2009-03-24 11:02:07 franklahm Exp $
+ * $Id: directory.c,v 1.96 2009-04-10 11:21:19 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
char *ibuf, *rbuf _U_;
int ibuflen _U_, *rbuflen;
{
+#ifdef HAVE_DIRFD
DIR *dp;
+#endif
int dfd;
struct vol *vol;
struct dir *dir;
if (movecwd( vol, dir ) < 0 )
return ( AFPERR_NOOBJ );
+/*
+ Assuming only OSens that have dirfd also may require fsyncing directories
+ in order to flush metadata e.g. Linux.
+*/
+
+#ifdef HAVE_DIRFD
if (NULL == ( dp = opendir( "." )) ) {
switch( errno ) {
case ENOENT :
LOG(log_error, logtype_afpd, "afp_syncdir(%s): %s",
dir->d_u_name, strerror(errno) );
closedir(dp); /* closes dfd too */
+#endif
- if ( -1 == (dfd = open(vol->vfs->ad_path(".", ADFLAGS_DIR), O_RDONLY))) {
+ if ( -1 == (dfd = open(vol->vfs->ad_path(".", ADFLAGS_DIR), O_RDWR))) {
switch( errno ) {
case ENOENT:
return( AFPERR_NOOBJ );