aboutsummaryrefslogtreecommitdiffstats
path: root/fsinfo/wr_fstab.c
diff options
context:
space:
mode:
Diffstat (limited to 'fsinfo/wr_fstab.c')
-rw-r--r--fsinfo/wr_fstab.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/fsinfo/wr_fstab.c b/fsinfo/wr_fstab.c
index 52cebbf27e11..166353eb00f1 100644
--- a/fsinfo/wr_fstab.c
+++ b/fsinfo/wr_fstab.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997-2006 Erez Zadok
+ * Copyright (c) 1997-2014 Erez Zadok
* Copyright (c) 1989 Jan-Simon Pendry
* Copyright (c) 1989 Imperial College of Science, Technology & Medicine
* Copyright (c) 1989 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.
*
@@ -89,7 +85,7 @@ static struct os_fstab_type {
"u4_0", write_ultrix_dkfstab, write_ultrix_dkrmount
}, /* Ultrix */
{
- 0, 0, 0
+ NULL, NULL, NULL
}
};
@@ -102,7 +98,7 @@ static struct os_fstab_type {
static void
write_aix1_dkfstab(FILE *ef, disk_fs *dp)
{
- char *hp = strdup(dp->d_host->h_hostname);
+ char *hp = xstrdup(dp->d_host->h_hostname);
char *p = strchr(hp, '.');
if (p)
@@ -123,8 +119,8 @@ write_aix1_dkfstab(FILE *ef, disk_fs *dp)
static void
write_aix1_dkrmount(FILE *ef, char *hn, fsmount *fp)
{
- char *h = strdup(fp->f_ref->m_dk->d_host->h_hostname);
- char *hp = strdup(h);
+ char *h = xstrdup(fp->f_ref->m_dk->d_host->h_hostname);
+ char *hp = xstrdup(h);
char *p = strchr(hp, '.');
if (p)
@@ -172,7 +168,7 @@ write_aix3_dkfstab(FILE *ef, disk_fs *dp)
static void
write_aix3_dkrmount(FILE *ef, char *hn, fsmount *fp)
{
- char *h = strdup(fp->f_ref->m_dk->d_host->h_hostname);
+ char *h = xstrdup(fp->f_ref->m_dk->d_host->h_hostname);
domain_strip(h, hn);
fprintf(ef, "\n%s:\n\tdev = %s:%s\n\tvfs = %s\n\ttype = %s\n\tvol = %s\n\topts = %s\n\tmount = true\n\tcheck = true\n\tfree = false\n",
@@ -206,7 +202,7 @@ write_ultrix_dkfstab(FILE *ef, disk_fs *dp)
static void
write_ultrix_dkrmount(FILE *ef, char *hn, fsmount *fp)
{
- char *h = strdup(fp->f_ref->m_dk->d_host->h_hostname);
+ char *h = xstrdup(fp->f_ref->m_dk->d_host->h_hostname);
domain_strip(h, hn);
fprintf(ef, "%s@%s:%s:%s:%s:0:0\n",
@@ -243,9 +239,9 @@ write_generic_dkrmount(FILE *ef, char *hn, fsmount *fp)
char *h;
if (fp->f_ref) {
- h = strdup(fp->f_ref->m_dk->d_host->h_hostname);
+ h = xstrdup(fp->f_ref->m_dk->d_host->h_hostname);
} else {
- h = strdup(fp->f_from);
+ h = xstrdup(fp->f_from);
}
domain_strip(h, hn);
fprintf(ef, "%s:%s %s %s %s 0 0\n",
@@ -261,8 +257,8 @@ write_generic_dkrmount(FILE *ef, char *hn, fsmount *fp)
static struct os_fstab_type *
find_fstab_type(host *hp)
{
- struct os_fstab_type *op = 0;
- char *os_name = 0;
+ struct os_fstab_type *op = NULL;
+ char *os_name = NULL;
again:;
if (os_name == 0) {