From: Neil Brown <neilb@suse.de>
Date: Fri, 16 Mar 2007 07:26:37 +0000 (+1100)
Subject: Remove nfs_mntent_t in favour of struct mntent
X-Git-Tag: nfs-utils-1-1-0-rc1~57
X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=a64b65aac7af65f96a24cd89fc07a31dbb5980ab;p=nfs-utils.git

Remove nfs_mntent_t in favour of struct mntent

They are identical and the later allows us to use hasmntent.
---

diff --git a/support/include/fstab.h b/support/include/fstab.h
index ab30c5a..64c8355 100644
--- a/support/include/fstab.h
+++ b/support/include/fstab.h
@@ -12,7 +12,7 @@ int mtab_does_not_exist(void);
 
 struct mntentchn {
 	struct mntentchn *nxt, *prev;
-	nfs_mntent_t m;
+	struct mntent m;
 };
 
 struct mntentchn *getmntoptfile (const char *file);
@@ -24,7 +24,7 @@ struct mntentchn *getfsspec (const char *spec);
 
 void lock_mtab (void);
 void unlock_mtab (void);
-void update_mtab (const char *special, nfs_mntent_t *with);
+void update_mtab (const char *special, struct mntent *with);
 
 #endif /* _NFS_FSTAB_H */
 
diff --git a/support/include/nfs_mntent.h b/support/include/nfs_mntent.h
index 76f348e..010df24 100644
--- a/support/include/nfs_mntent.h
+++ b/support/include/nfs_mntent.h
@@ -5,15 +5,7 @@
 
 #ifndef _NFS_MNTENT_H
 #define _NFS_MNTENT_H
-
-typedef struct nfs_mntent_s {
-	const char *mnt_fsname;
-	const char *mnt_dir;
-	const char *mnt_type;
-	const char *mnt_opts;
-	int mnt_freq;
-	int mnt_passno;
-} nfs_mntent_t;
+#include <mntent.h>
 
 #define ERR_MAX 5
 
@@ -27,8 +19,8 @@ typedef struct mntFILEstruct {
 
 mntFILE *nfs_setmntent (const char *file, char *mode);
 void nfs_endmntent (mntFILE *mfp);
-int nfs_addmntent (mntFILE *mfp, nfs_mntent_t *mnt);
+int nfs_addmntent (mntFILE *mfp, struct mntent *mnt);
 struct nfs_mntent *my_getmntent (mntFILE *mfp);
-nfs_mntent_t *nfs_getmntent (mntFILE *mfp);
+struct mntent *nfs_getmntent (mntFILE *mfp);
 
 #endif /* _NFS_MNTENT_H */
diff --git a/support/nfs/fstab.c b/support/nfs/fstab.c
index ba7e580..c900f3c 100644
--- a/support/nfs/fstab.c
+++ b/support/nfs/fstab.c
@@ -124,7 +124,7 @@ discard_mntentchn(struct mntentchn *mc0) {
 static void
 read_mntentchn(mntFILE *mfp, const char *fnam, struct mntentchn *mc0) {
 	struct mntentchn *mc = mc0;
-	nfs_mntent_t *mnt;
+	struct mntent *mnt;
 
 	while ((mnt = nfs_getmntent(mfp)) != NULL) {
 		if (!streq(mnt->mnt_type, MNTTYPE_IGNORE)) {
@@ -444,7 +444,7 @@ lock_mtab (void) {
  */
 
 void
-update_mtab (const char *dir, nfs_mntent_t *instead) {
+update_mtab (const char *dir, struct mntent *instead) {
 	mntFILE *mfp, *mftmp;
 	const char *fnam = MOUNTED;
 	struct mntentchn mtabhead;	/* dummy */
diff --git a/support/nfs/nfs_mntent.c b/support/nfs/nfs_mntent.c
index d1d124b..a3fecfc 100644
--- a/support/nfs/nfs_mntent.c
+++ b/support/nfs/nfs_mntent.c
@@ -124,7 +124,7 @@ nfs_endmntent (mntFILE *mfp) {
 }
 
 int
-nfs_addmntent (mntFILE *mfp, nfs_mntent_t *mnt) {
+nfs_addmntent (mntFILE *mfp, struct mntent *mnt) {
 	char *m1, *m2, *m3, *m4;
 	int res;
 
@@ -147,10 +147,10 @@ nfs_addmntent (mntFILE *mfp, nfs_mntent_t *mnt) {
 }
 
 /* Read the next entry from the file fp. Stop reading at an incorrect entry. */
-nfs_mntent_t *
+struct mntent *
 nfs_getmntent (mntFILE *mfp) {
 	static char buf[4096];
-	static nfs_mntent_t me;
+	static struct mntent me;
 	char *s;
 
  again:
diff --git a/utils/mount/nfsumount.c b/utils/mount/nfsumount.c
index 4208ade..eb3d1fb 100644
--- a/utils/mount/nfsumount.c
+++ b/utils/mount/nfsumount.c
@@ -147,7 +147,7 @@ int del_mtab(const char *spec, const char *node)
                 res = mount(spec, node, NULL,
                             MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL);
                 if (res == 0) {
-                        nfs_mntent_t remnt;
+                        struct mntent remnt;
                         fprintf(stderr,
                                 _("umount: %s busy - remounted read-only\n"),
                                 spec);