X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Flib%2Fmntent_cache.c;h=14b304da5290e3530948ca55aabed4bd36562dd6;hb=897707854a8240d026e933215009f931bb9c5762;hp=def077c47e42f4828a81513c89fb8abfddfcd167;hpb=b5db61d8cb9075592caf167e8b23fe5f6be125e8;p=bacula%2Fbacula diff --git a/bacula/src/lib/mntent_cache.c b/bacula/src/lib/mntent_cache.c index def077c47e..14b304da52 100644 --- a/bacula/src/lib/mntent_cache.c +++ b/bacula/src/lib/mntent_cache.c @@ -41,7 +41,7 @@ * - DARWIN (OSX) * - IRIX * - AIX - * - OSF1 (True64) + * - OSF1 (Tru64) * - Solaris * * Currently we only use this code for Linux and OSF1 based fstype determination. @@ -68,19 +68,22 @@ #include #if defined(HAVE_GETMNTENT) -#if defined(HAVE_LINUX_OS) || defined(HAVE_HPUX_OS) +#if defined(HAVE_LINUX_OS) || defined(HAVE_HPUX_OS) || defined(HAVE_AIX_OS) #include #elif defined(HAVE_SUN_OS) #include #endif /* HAVE_GETMNTENT */ #elif defined(HAVE_GETMNTINFO) -#if defined(HAVE_DARWIN_OS) +#if defined(HAVE_OPENBSD_OS) #include -#include -#include -#else +#include +#elif defined(HAVE_NETBSD_OS) #include #include +#else +#include +#include +#include #endif #elif defined(HAVE_AIX_OS) #include @@ -156,7 +159,7 @@ static void refresh_mount_cache(void) #if defined(HAVE_GETMNTENT) FILE *fp; struct stat st; -#if defined(HAVE_LINUX_OS) || defined(HAVE_HPUX_OS) || defined(HAVE_IRIX_OS) +#if defined(HAVE_LINUX_OS) || defined(HAVE_HPUX_OS) || defined(HAVE_IRIX_OS) || defined(HAVE_AIX_OS) struct mntent *mnt; #if defined(HAVE_LINUX_OS) @@ -173,6 +176,10 @@ static void refresh_mount_cache(void) if ((fp = setmntent(MOUNTED, "r")) == (FILE *)NULL) { return; } +#elif defined(HAVE_AIX_OS) + if ((fp = setmntent(MNTTAB, "r")) == (FILE *)NULL) { + return; + } #endif while ((mnt = getmntent(fp)) != (struct mntent *)NULL) { @@ -203,13 +210,20 @@ static void refresh_mount_cache(void) #elif defined(HAVE_GETMNTINFO) int cnt; struct stat st; -#if defined(HAVE_DARWIN_OS) +#if defined(HAVE_NETBSD_OS) + struct statvfs *mntinfo; +#else struct statfs *mntinfo; +#endif +#if defined(ST_NOWAIT) + int flags = ST_NOWAIT; +#elif defined(MNT_NOWAIT) + int flags = MNT_NOWAIT; #else - struct statvfs *mntinfo; + 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,