They are identical and the later allows us to use hasmntent.
struct mntentchn {
struct mntentchn *nxt, *prev;
- nfs_mntent_t m;
+ struct mntent m;
};
struct mntentchn *getmntoptfile (const char *file);
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 */
#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
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 */
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)) {
*/
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 */
}
int
-nfs_addmntent (mntFILE *mfp, nfs_mntent_t *mnt) {
+nfs_addmntent (mntFILE *mfp, struct mntent *mnt) {
char *m1, *m2, *m3, *m4;
int res;
}
/* 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:
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);