aboutsummaryrefslogtreecommitdiffstats
path: root/fsinfo/fsi_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'fsinfo/fsi_util.c')
-rw-r--r--fsinfo/fsi_util.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/fsinfo/fsi_util.c b/fsinfo/fsi_util.c
index 5e7571fd4db2..f8ff313cc426 100644
--- a/fsinfo/fsi_util.c
+++ b/fsinfo/fsi_util.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.
@@ -13,11 +13,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.
*
@@ -201,7 +197,7 @@ gen_hdr(FILE *ef, char *hn)
static void
make_banner(FILE *fp)
{
- time_t t = time((time_t *) 0);
+ time_t t = time((time_t *) NULL);
char *cp = ctime(&t);
fprintf(fp,
@@ -235,7 +231,7 @@ show_new(char *msg)
void
show_area_being_processed(char *area, int n)
{
- static char *last_area = 0;
+ static char *last_area = NULL;
if (verbose < 0)
return;
@@ -316,9 +312,9 @@ new_automount(char *name)
ap->a_ioloc = current_location();
ap->a_name = name;
- ap->a_volname = 0;
- ap->a_mount = 0;
- ap->a_opts = 0;
+ ap->a_volname = NULL;
+ ap->a_mount = NULL;
+ ap->a_opts = NULL;
show_new("automount");
return ap;
}
@@ -355,7 +351,7 @@ set_host(host *hp, int k, char *v)
int m = 1 << k;
if (hp->h_mask & m) {
- yyerror("host field \"%s\" already set", host_strings[k]);
+ fsi_error("host field \"%s\" already set", host_strings[k]);
return;
}
hp->h_mask |= m;
@@ -363,11 +359,11 @@ set_host(host *hp, int k, char *v)
switch (k) {
case HF_HOST:{
- char *p = strdup(v);
+ char *p = xstrdup(v);
dict_ent *de = dict_locate(dict_of_hosts, v);
if (de)
- yyerror("duplicate host %s!", v);
+ fsi_error("duplicate host %s!", v);
else
dict_add(dict_of_hosts, v, (char *) hp);
hp->h_hostname = v;
@@ -442,7 +438,7 @@ set_ether_if(ether_if *ep, int k, char *v)
int m = 1 << k;
if (ep->e_mask & m) {
- yyerror("netif field \"%s\" already set", ether_if_strings[k]);
+ fsi_error("netif field \"%s\" already set", ether_if_strings[k]);
return;
}
ep->e_mask |= m;
@@ -452,7 +448,7 @@ set_ether_if(ether_if *ep, int k, char *v)
case EF_INADDR:{
ep->e_inaddr.s_addr = inet_addr(v);
if ((int) ep->e_inaddr.s_addr == (int) INADDR_NONE)
- yyerror("malformed IP dotted quad: %s", v);
+ fsi_error("malformed IP dotted quad: %s", v);
XFREE(v);
}
break;
@@ -463,7 +459,7 @@ set_ether_if(ether_if *ep, int k, char *v)
if ((sscanf(v, "0x%lx", &nm) == 1 || sscanf(v, "%lx", &nm) == 1) && nm != 0)
ep->e_netmask = htonl(nm);
else
- yyerror("malformed netmask: %s", v);
+ fsi_error("malformed netmask: %s", v);
XFREE(v);
}
break;
@@ -485,7 +481,7 @@ set_disk_fs(disk_fs *dp, int k, char *v)
int m = 1 << k;
if (dp->d_mask & m) {
- yyerror("fs field \"%s\" already set", disk_fs_strings[k]);
+ fsi_error("fs field \"%s\" already set", disk_fs_strings[k]);
return;
}
dp->d_mask |= m;
@@ -546,7 +542,7 @@ set_mount(fsi_mount *mp, int k, char *v)
int m = 1 << k;
if (mp->m_mask & m) {
- yyerror("mount tree field \"%s\" already set", mount_strings[k]);
+ fsi_error("mount tree field \"%s\" already set", mount_strings[k]);
return;
}
mp->m_mask |= m;
@@ -590,7 +586,7 @@ set_fsmount(fsmount *fp, int k, char *v)
int m = 1 << k;
if (fp->f_mask & m) {
- yyerror("mount field \"%s\" already set", fsmount_strings[k]);
+ fsi_error("mount field \"%s\" already set", fsmount_strings[k]);
return;
}
fp->f_mask |= m;