#include <afs/afsint.h>
#if !defined(AFS_SGI_ENV)
-#ifdef AFS_VFSINCL_ENV
-#define VFS
-#ifdef AFS_SUN5_ENV
-#include <sys/fs/ufs_fs.h>
-#else
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-#include <ufs/ufs/dinode.h>
-#include <ufs/ffs/fs.h>
-#else
-#include <ufs/fs.h>
-#endif
-#endif
-#else /* AFS_VFSINCL_ENV */
-#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV) && !defined(AFS_DARWIN_ENV)
-#include <sys/fs.h>
-#endif
-#endif /* AFS_VFSINCL_ENV */
+# ifdef AFS_VFSINCL_ENV
+# define VFS
+# ifdef AFS_SUN5_ENV
+# include <sys/fs/ufs_fs.h>
+# else
+# if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+# include <ufs/ufs/dinode.h>
+# include <ufs/ffs/fs.h>
+# else
+# include <ufs/fs.h>
+# endif
+# endif
+# else /* AFS_VFSINCL_ENV */
+# if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV) && !defined(AFS_DARWIN_ENV)
+# include <sys/fs.h>
+# endif
+# endif /* AFS_VFSINCL_ENV */
#endif /* AFS_SGI_ENV */
+
#include <sys/file.h>
+
#ifdef AFS_AIX_ENV
-#include <sys/vfs.h>
-#else
-#ifdef AFS_HPUX_ENV
-#include <mntent.h>
-#else
-#if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
-#ifdef AFS_SUN5_ENV
-#include <sys/mnttab.h>
-#include <sys/mntent.h>
-#else
-#include <mntent.h>
-#endif
-#else
-#if defined(AFS_SGI_ENV)
-#include <mntent.h>
-#else
-#ifdef AFS_LINUX22_ENV
-#include <mntent.h>
-#else
-#include <fstab.h>
-#endif
-#endif
-#endif /* AFS_SGI_ENV */
-#endif /* AFS_HPUX_ENV */
+# include <sys/vfs.h>
+#else
+# ifdef AFS_HPUX_ENV
+# include <mntent.h>
+# else
+# if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
+# ifdef AFS_SUN5_ENV
+# include <sys/mnttab.h>
+# include <sys/mntent.h>
+# else
+# include <mntent.h>
+# endif
+# else
+# if defined(AFS_SGI_ENV)
+# include <mntent.h>
+# else
+# ifdef AFS_LINUX22_ENV
+# include <mntent.h>
+# else
+# include <fstab.h>
+# endif
+# endif
+# endif /* AFS_SGI_ENV */
+# endif /* AFS_HPUX_ENV */
#endif
+
#include <sys/wait.h>
#include <setjmp.h>
struct mnttab mnt;
FILE *mntfile;
#else
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX22_ENV)
+# if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX22_ENV)
struct mntent *mntent;
FILE *mfd;
-#else
+# else
struct fstab *fsent;
-#endif
-#endif
+# endif
+#endif /* AFS_SUN5_ENV */
+
#ifdef AFS_AIX_ENV
int nmounts;
struct vmount *vmountp;
(struct vmount *)((int)vmountp + vmountp->vmt_length)) {
char *part = vmt2dataptr(vmountp, VMT_STUB);
#else
-#ifdef AFS_SUN5_ENV
+# ifdef AFS_SUN5_ENV
if (!(mntfile = fopen(MNTTAB, "r"))) {
return NULL;
}
while (!getmntent(mntfile, &mnt)) {
char *part = mnt.mnt_mountp;
-#else
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX22_ENV)
-#ifdef AFS_LINUX22_ENV
+# else
+# if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX22_ENV)
+# ifdef AFS_LINUX22_ENV
if ((mfd = setmntent("/proc/mounts", "r")) == NULL) {
if ((mfd = setmntent("/etc/mtab", "r")) == NULL) {
return NULL;
}
}
-#else
+# else
if ((mfd = setmntent(MOUNTED /*MNTTAB*/, "r")) == NULL) {
return NULL;
}
-#endif
+# endif
while ((mntent = getmntent(mfd))) {
char *part = mntent->mnt_dir;
-#else
+# else
setfsent();
while ((fsent = getfsent())) {
char *part = fsent->fs_file;
-#endif
-#endif /* AFS_SGI_ENV */
+# endif
+# endif /* AFS_SGI_ENV */
#endif
struct stat status;
#ifdef AFS_AIX_ENV
if (vmountp->vmt_flags & (MNT_READONLY | MNT_REMOVABLE | MNT_REMOTE))
continue; /* Ignore any "special" partitions */
#else
-#ifdef AFS_SUN5_ENV
+# ifdef AFS_SUN5_ENV
/* Ignore non ufs or non read/write partitions */
if ((strcmp(mnt.mnt_fstype, "ufs") != 0)
|| (strncmp(mnt.mnt_mntopts, "ro,ignore", 9) == 0))
continue;
-#else
-#if defined(AFS_LINUX22_ENV)
+# else
+# if defined(AFS_LINUX22_ENV)
if (strcmp(mntent->mnt_type, "ext2"))
continue;
-#else
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV)
+# else
+# if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV)
if (!hasmntopt(mntent, MNTOPT_RW))
continue;
-#else
+# else
if (strcmp(fsent->fs_type, "rw") != 0)
continue; /* Ignore non read/write partitions */
-#endif /* AFS_LINUX22_ENV */
-#endif /* AFS_SGI_ENV */
-#endif
+# endif /* AFS_LINUX22_ENV */
+# endif /* AFS_SGI_ENV */
+# endif
#endif
/* Only keep track of "/vicepx" partitions since it can get hairy when NFS mounts are involved.. */
if (strncmp(part, VICE_PARTITION_PREFIX, VICE_PREFIX_SIZE)) {
#ifdef AFS_AIX_ENV
strcpy(pbuffer, vmt2dataptr(vmountp, VMT_OBJECT));
#else
-#ifdef AFS_SUN5_ENV
+# ifdef AFS_SUN5_ENV
strcpy(pbuffer, mnt.mnt_special);
-#else
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX22_ENV)
+# else
+# if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX22_ENV)
strcpy(pbuffer, mntent->mnt_fsname);
-#else
+# else
strcpy(pbuffer, fsent->fs_spec);
-#endif
-#endif /* AFS_SGI_ENV */
+# endif
+# endif /* AFS_SGI_ENV */
#endif
if (wpath) {
strcpy(pbuf, pbuffer);
#ifdef AFS_SUN5_ENV
(void)fclose(mntfile);
#else
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX22_ENV)
+# if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX22_ENV)
endmntent(mfd);
-#else
-#ifndef AFS_AIX_ENV
+# else
+# ifndef AFS_AIX_ENV
endfsent();
-#endif
-#endif
+# endif
+# endif
#endif /* AFS_SGI_ENV */
return NULL;
}