+ * Make it possible to use --enable-timeout-stat as well as
+ --enable-timeout-stat=static for a static background process which
+ does the final stat system calls
+ * Do not mix HAVE_TIMEOUT_STAT with WITH_TIMEOUT_STAT
* Add timeout.c/timeout.h for static background process which is able
to read the file name from pipe, does the stat(2) system call, and
writes the result back to a pipe.
# Call fork before all stat calls to stop hanging on NFS mounts
AC_SUBST([WITH_TIMEOUT_STAT])
AC_ARG_ENABLE([timeout_stat],
- [AS_HELP_STRING([--enable-timeout-stat], [Use a timeout on stat calls])],
+ [AS_HELP_STRING([--enable-timeout-stat], [Use a timeout on stat calls (optional with argument "static" for a static background process)])],
[enable_timeout_stat=$enableval],
[enable_timeout_stat="no"])
if test "$enable_timeout_stat" = "yes"; then
AC_DEFINE([WITH_TIMEOUT_STAT], [1], [Use timeout on stat calls])
fi
+if test "$enable_timeout_stat" = "static"; then
+ AC_DEFINE([WITH_TIMEOUT_STAT], [2], [Use timeout on stat calls])
+fi
+AM_CONDITIONAL([WANT_TIMEOUT_STAT], [test "$enable_timeout_stat" = "static"])
# Enable hardened compile and link flags
AC_ARG_ENABLE([harden_flags],
endif
fuser_SOURCES = fuser.c comm.h signals.c signals.h i18n.h fuser.h lists.h
+if WANT_TIMEOUT_STAT
+ fuser_SOURCES += timeout.c timeout.h
+endif
fuser_LDADD = @LIBINTL@
#endif
static char *expandpath(const char *path);
-typedef int (*stat_t)(const char*, struct stat*);
#ifdef WITH_TIMEOUT_STAT
+# if (WITH_TIMEOUT_STAT == 2)
+# include "timeout.h"
+# else
+typedef int (*stat_t)(const char*, struct stat*);
static int timeout(stat_t func, const char *path, struct stat *buf, unsigned int seconds);
+# endif
#else
#define timeout(func,path,buf,dummy) (func)((path),(buf))
#endif /* WITH_TIMEOUT_STAT */
* Execute stat(2) system call with timeout to avoid deadlock
* on network based file systems.
*/
-#ifdef HAVE_TIMEOUT_STAT
+#if defined(WITH_TIMEOUT_STAT) && (WITH_TIMEOUT_STAT == 1)
static sigjmp_buf jenv;