src/loop.h was stolen from util-linux package which in turn stole it from
the Linux kernel.
+fuser on network fs
+-------------------
+On network filesystems, fuser can hang because its trying to stat files
+that may go away. If you use the --with-timeout-stat option during
+the configure step then fuser will fork a process to run stat. This means
+fuser doesn't hang, but it is much slower.
+
Translations
------------
My thanks for the various translators who have cheerfully given me the po
fi
AC_SUBST([SELINUX_LIB])
+dnl 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])],
+ [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
+
dnl ipv4 only option
AC_SUBST([WITH_IPV6])
AC_ARG_ENABLE([ipv6],
static char *expandpath(const char *path);
typedef int (*stat_t)(const char*, struct stat*);
+#ifdef WITH_TIMEOUT_STAT
static int timeout(stat_t func, const char *path, struct stat *buf, unsigned int seconds);
+#else
+#define timeout(func,path,buf,dummy) (func)((path),(buf))
+#endif /* WITH_TIMEOUT_STAT */
static void usage(const char *errormsg)
{
if ((st = (struct stat*)malloc(sizeof(struct stat))) == NULL)
return NULL;
snprintf(pathname, 256, "/proc/%d/%s", pid, filename);
- if (timeout(stat, pathname, st, 5) != 0)
- goto out;
+ if (timeout(stat, pathname, st, 5) != 0) {
+ free(st);
+ return NULL;
+ }
return st;
-out:
- free(st);
- return NULL;
}
static void
siglongjmp(jenv, 1);
}
+#ifdef HAVE_TIMEOUT_STAT
static int
timeout(stat_t func, const char *path, struct stat *buf, unsigned int seconds)
{
err:
return -1;
}
+#endif /* HAVE_TIMEOUT_STAT */
#ifdef _LISTS_H
/*