From: Marco van Wieringen Date: Sat, 18 Sep 2010 08:54:50 +0000 (+0200) Subject: Fix getmntinfo handling on FreeBSD as it seems its the same as OSX (no real surprise). X-Git-Tag: Release-5.2.1~1099 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=722afb1348438b246dd709b195d2ad0a314daa29;p=bacula%2Fbacula Fix getmntinfo handling on FreeBSD as it seems its the same as OSX (no real surprise). --- diff --git a/bacula/src/lib/mntent_cache.c b/bacula/src/lib/mntent_cache.c index def077c47e..8d9aacf84f 100644 --- a/bacula/src/lib/mntent_cache.c +++ b/bacula/src/lib/mntent_cache.c @@ -74,7 +74,7 @@ #include #endif /* HAVE_GETMNTENT */ #elif defined(HAVE_GETMNTINFO) -#if defined(HAVE_DARWIN_OS) +#if defined(HAVE_DARWIN_OS) || defined(HAVE_FREEBSD_OS) #include #include #include @@ -203,13 +203,20 @@ static void refresh_mount_cache(void) #elif defined(HAVE_GETMNTINFO) int cnt; struct stat st; -#if defined(HAVE_DARWIN_OS) +#if defined(HAVE_DARWIN_OS) || defined(HAVE_FREEBSD_OS) struct statfs *mntinfo; #else struct statvfs *mntinfo; #endif +#if defined(ST_NOWAIT) + int flags = ST_NOWAIT; +#elif defined(MNT_NOWAIT) + int flags = MNT_NOWAIT; +#else + int flags = 0; +#endif - if ((cnt = getmntinfo(&mntinfo, MNT_NOWAIT)) > 0) { + if ((cnt = getmntinfo(&mntinfo, flags)) > 0) { while (cnt > 0) { if (stat(mntinfo->f_mntonname, &st) == 0) { add_mntent_mapping(st.st_dev,