# HG changeset patch # User Jim Meyering # Date 864485001 0 # Node ID 09fe18b516773b4ad06a4c6a541b6b5dac07b485 # Parent 9a12bc8964d5d5851adc272ccb2964eaf9db5de6 (read_filesystem_list): Show automount-related duplicate filesystems only when --all specified. With suggestions from Stuart Kemp. diff -r 9a12bc8964d5 -r 09fe18b51677 lib/mountlist.c --- a/lib/mountlist.c Sat May 24 14:42:40 1997 +0000 +++ b/lib/mountlist.c Sat May 24 14:43:21 1997 +0000 @@ -1,5 +1,5 @@ /* mountlist.c -- return a list of mounted filesystems - Copyright (C) 1991, 1992 Free Software Foundation, Inc. + Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -99,6 +99,17 @@ # define MOUNTED_GETMNTTBL #endif +#ifdef HAVE_SYS_MNTENT_H +/* This is to get MNTOPT_IGNORE on e.g. SVR4. */ +# include +#endif + +#if defined (MNTOPT_IGNORE) && defined (HAVE_HASMNTOPT) +# define MNT_IGNORE(M) hasmntopt ((M), MNTOPT_IGNORE) +#else +# define MNT_IGNORE(M) 0 +#endif + #ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ /* Return the value of the hexadecimal number represented by CP. No prefix (like '0x') or suffix (like 'h') is expected to be @@ -502,6 +513,10 @@ while ((ret = getmntent (fp, &mnt)) == 0) { + /* Don't show automounted filesystems twice on e.g., Solaris. */ + if (!all_fs && MNT_IGNORE (&mnt)) + continue; + me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry)); me->me_devname = xstrdup (mnt.mnt_special); me->me_mountdir = xstrdup (mnt.mnt_mountp);