aboutsummaryrefslogtreecommitdiff
path: root/conf/mtab/mtab_bsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'conf/mtab/mtab_bsd.c')
-rw-r--r--conf/mtab/mtab_bsd.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/conf/mtab/mtab_bsd.c b/conf/mtab/mtab_bsd.c
index fe3991aa575d..203a265e13af 100644
--- a/conf/mtab/mtab_bsd.c
+++ b/conf/mtab/mtab_bsd.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997-2006 Erez Zadok
+ * Copyright (c) 1997-2014 Erez Zadok
* Copyright (c) 1990 Jan-Simon Pendry
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
* Copyright (c) 1990 The Regents of the University of California.
@@ -16,11 +16,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgment:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -53,6 +49,9 @@
#include <am_defs.h>
#include <amu.h>
+#if __NetBSD_Version__ > 200030000
+#define statfs statvfs
+#endif
static mntent_t *
mnt_dup(struct statfs *mp)
@@ -60,8 +59,8 @@ mnt_dup(struct statfs *mp)
mntent_t *new_mp = ALLOC(mntent_t);
char *ty;
- new_mp->mnt_fsname = strdup(mp->f_mntfromname);
- new_mp->mnt_dir = strdup(mp->f_mntonname);
+ new_mp->mnt_fsname = xstrdup(mp->f_mntfromname);
+ new_mp->mnt_dir = xstrdup(mp->f_mntonname);
#ifdef HAVE_STRUCT_STATFS_F_FSTYPENAME
ty = mp->f_fstypename;
@@ -93,8 +92,8 @@ mnt_dup(struct statfs *mp)
}
#endif /* not HAVE_STRUCT_STATFS_F_FSTYPENAME */
- new_mp->mnt_type = strdup(ty);
- new_mp->mnt_opts = strdup("unset");
+ new_mp->mnt_type = xstrdup(ty);
+ new_mp->mnt_opts = xstrdup("unset");
new_mp->mnt_freq = 0;
new_mp->mnt_passno = 0;
@@ -138,7 +137,7 @@ read_mtab(char *fs, const char *mnttabname)
/*
* Terminate the list
*/
- *mpp = 0;
+ *mpp = NULL;
return mhp;
}