From ca57057f598bfc7119f79f71bf38ec88244ab396 Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Wed, 31 Aug 2016 00:08:49 +0000 Subject: Import am-utils 6.2, Suggested by: pfg@ Obtained from: ftp://ftp.am-utils.org/pub/am-utils/ --- conf/mtab/mtab_bsd.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'conf/mtab/mtab_bsd.c') 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 #include +#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; } -- cgit v1.2.3