X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmountlist.c;h=5a6d664c5946ad5f5ce27b17fe8e2589a6a897e6;hb=fa145a9f05c90f266754ff5b8e9ff2c81fc5ef3d;hp=5933f76881e2c7a2b1eddbb33e23f23781426c06;hpb=aa5959b9b07f6667b916f8a3d84ca0b29b6933b8;p=gnulib.git diff --git a/lib/mountlist.c b/lib/mountlist.c index 5933f7688..5a6d664c5 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -12,8 +12,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include @@ -80,6 +80,10 @@ void error (); #include #endif +#ifdef MOUNTED_LISTMNTENT +#include +#endif + #ifdef MOUNTED_GETMNTENT2 /* SVR4. */ #include #endif @@ -195,6 +199,36 @@ read_filesystem_list (need_fs_type, all_fs) me->me_next = NULL; mount_list = mtail = me; +#ifdef MOUNTED_LISTMNTENT + { + struct tabmntent *mntlist, *p; + struct mntent *mnt; + struct mount_entry *me; + + /* the third and fourth arguments could be used to filter mounts, + but Crays doesn't seem to have any mounts that we want to + remove. Specifically, automount create normal NFS mounts. + */ + + if(listmntent(&mntlist, KMTAB, NULL, NULL) < 0) + return NULL; + p = mntlist; + while(p){ + mnt = p->ment; + me = (struct mount_entry*) xmalloc(sizeof (struct mount_entry)); + me->me_devname = xstrdup(mnt->mnt_fsname); + me->me_mountdir = xstrdup(mnt->mnt_dir); + me->me_type = xstrdup(mnt->mnt_type); + me->me_dev = -1; + me->me_next = NULL; + mtail->me_next = me; + mtail = me; + p = p->next; + } + freemntlist(mntlist); + } +#endif + #ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ { struct mntent *mnt;