* ALL: use '0' properly when assigning or passing it to functions.
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 7 Aug 2005 03:03:41 +0000 (03:03 +0000)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 7 Aug 2005 03:03:41 +0000 (03:03 +0000)
If in the context pointer, use NULL.  If in the context of a
single char (say within a string), the use '0'.  This is just to
make the code clearer.

68 files changed:
ChangeLog
amd/am_ops.c
amd/amd.c
amd/amfs_auto.c
amd/amfs_generic.c
amd/amfs_host.c
amd/amfs_nfsx.c
amd/autil.c
amd/info_exec.c
amd/info_passwd.c
amd/map.c
amd/mapc.c
amd/mntfs.c
amd/nfs_start.c
amd/nfs_subr.c
amd/ops_nfs.c
amd/opts.c
amd/readdir.c
amd/restart.c
amd/rpc_fwd.c
amd/sched.c
amd/srvr_amfs_auto.c
amd/srvr_nfs.c
conf/autofs/autofs_linux.c
conf/checkmount/checkmount_aix.c
conf/mount/mount_linux.c
conf/mtab/mtab_aix.c
conf/mtab/mtab_bsd.c
conf/mtab/mtab_file.c
conf/mtab/mtab_isc3.c
conf/mtab/mtab_linux.c
conf/mtab/mtab_mach3.c
conf/mtab/mtab_osf.c
conf/mtab/mtab_svr4.c
conf/mtab/mtab_ultrix.c
conf/nfs_prot/nfs_prot_aix4_3.h
conf/nfs_prot/nfs_prot_freebsd2.h
conf/nfs_prot/nfs_prot_hpux11.h
conf/nfs_prot/nfs_prot_netbsd.h
conf/nfs_prot/nfs_prot_netbsd1_3.h
conf/nfs_prot/nfs_prot_netbsd1_4.h
conf/nfs_prot/nfs_prot_nextstep.h
conf/nfs_prot/nfs_prot_osf4.h
conf/nfs_prot/nfs_prot_osf5.h
conf/nfs_prot/nfs_prot_ultrix.h
conf/transp/transp_sockets.c
conf/transp/transp_tli.c
conf/umount/umount_aix.c
conf/umount/umount_bsd44.c
conf/umount/umount_default.c
conf/umount/umount_linux.c
conf/umount/umount_osf.c
fixmount/fixmount.c
fsinfo/fsi_analyze.c
fsinfo/fsi_gram.y
fsinfo/fsi_lex.l
fsinfo/fsi_util.c
fsinfo/wr_fstab.c
hlfsd/hlfsd.c
hlfsd/homedir.c
hlfsd/stubs.c
include/am_xdr_func.h
libamu/mount_fs.c
libamu/strdup.c
libamu/strutil.c
libamu/xdr_func.c
libamu/xutil.c
wire-test/wire-test.c

index dd9d16777a8d849576801fbca6823bba9b3f1ee8..dc1fdbc4cedf84061ac319bd4d8a3f6abdff6f9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2005-08-06  Erez Zadok  <ezk@cs.sunysb.edu>
 
+       * ALL: use '0' properly when assigning or passing it to functions.
+       If in the context pointer, use NULL.  If in the context of a
+       single char (say within a string), the use '\0'.  This is just to
+       make the code clearer.
+
        * m4/macros/header_templates.m4: template for HAVE_MAP_SUN.
 
        * amd/mapc.c (maptypes): add placeholder for Sun-syntax map
index e6e9a44ab2bfc5ce1d82ae805de92212a0f06166..8e7c7b6a8a7c16d402b876d15c5d299b21d79607 100644 (file)
@@ -362,7 +362,7 @@ am_ops *
 ops_search(char *type)
 {
   am_ops **vp;
-  am_ops *rop = 0;
+  am_ops *rop = NULL;
   for (vp = vops; (rop = *vp); vp++)
     if (STREQ(rop->fs_type, type))
       break;
@@ -373,7 +373,7 @@ ops_search(char *type)
 am_ops *
 ops_match(am_opts *fo, char *key, char *g_key, char *path, char *keym, char *map)
 {
-  am_ops *rop = 0;
+  am_ops *rop = NULL;
   char *link_dir;
 
   /*
@@ -451,7 +451,7 @@ ops_match(am_opts *fo, char *key, char *g_key, char *path, char *keym, char *map
   /* Normalize the sublink and make it absolute */
   link_dir = fo->opt_sublink;
   if (link_dir && link_dir[0] && link_dir[0] != '/') {
-    link_dir = str3cat((char *) 0, fo->opt_fs, "/", link_dir);
+    link_dir = str3cat((char *) NULL, fo->opt_fs, "/", link_dir);
     normalize_slash(link_dir);
     XFREE(fo->opt_sublink);
     fo->opt_sublink = link_dir;
index ead5ac2ef313afbb0c4f2961e8ae15cc737ce23b..a1e5a38399e02fbeec081d06c063954688b3c9cf 100644 (file)
--- a/amd/amd.c
+++ b/amd/amd.c
@@ -374,7 +374,7 @@ do_memory_locking(void)
 #endif /* HAVE_PLOCK || HAVE_MLOCKALL */
 
 #if defined(HAVE_MADVISE) && defined(MADV_PROTECT)
-    madvise(0, 0, MADV_PROTECT); /* may be redundant of the above worked out */
+    madvise(NULL, 0, MADV_PROTECT); /* may be redundant of the above worked out */
 #endif /* defined(HAVE_MADVISE) && defined(MADV_PROTECT) */
 }
 
index 1268b6e4123f319a3a6578dd3b4379a9755cf249..1d8365b0ee38ad5dd16f3c3e8afd2388e6352934 100644 (file)
@@ -147,7 +147,7 @@ amfs_auto_mount(am_node *mp, mntfs *mf)
     char *ppref = mp->am_parent->am_pref;
     if (ppref == 0)
       ppref = "";
-    mp->am_pref = str3cat((char *) 0, ppref, mp->am_name, "/");
+    mp->am_pref = str3cat((char *) NULL, ppref, mp->am_name, "/");
   }
 
 #ifdef HAVE_FS_AUTOFS
index 1330ed4c763825058a1a967ce8f753363b2e1c9a..795232268077bd4cabd9014974dd9a5504fe3626 100644 (file)
@@ -108,7 +108,7 @@ amfs_lookup_node(am_node *mp, char *fname, int *error_return)
   int error = 0;               /* Error so far */
   int in_progress = 0;         /* # of (un)mount in progress */
   mntfs *mf;
-  char *expanded_fname = 0;
+  char *expanded_fname = NULL;
 
   dlog("in amfs_lookup_node");
 
@@ -256,7 +256,7 @@ amfs_lookup_one_mntfs(am_node *new_mp, mntfs *mf, char *ivec,
   am_ops *p;
   am_opts *fs_opts;
   mntfs *new_mf;
-  char *mp_dir = 0;
+  char *mp_dir = NULL;
 #ifdef HAVE_FS_AUTOFS
   int on_autofs = 1;
 #endif /* HAVE_FS_AUTOFS */
@@ -414,7 +414,7 @@ amfs_lookup_mntfs(am_node *new_mp, int *error_return)
       /*
        * Pick up new defaults
        */
-      def_opts = str3cat((char *) 0, def_opts, ";", *cur_ivec + 1);
+      def_opts = str3cat((char *) NULL, def_opts, ";", *cur_ivec + 1);
       dlog("Setting def_opts to \"%s\"", def_opts);
       continue;
     } else
@@ -438,7 +438,7 @@ amfs_lookup_mntfs(am_node *new_mp, int *error_return)
        dlog("Resetting the default options, a single dash '-' was found.");
       } else {
        /* append options to /default options */
-       def_opts = str3cat((char *) 0, orig_def_opts, ";", *cur_ivec + 1);
+       def_opts = str3cat((char *) NULL, orig_def_opts, ";", *cur_ivec + 1);
        dlog("Resetting def_opts to \"%s\"", def_opts);
       }
       continue;
@@ -638,7 +638,6 @@ free_continuation(struct continuation *cp)
     free_mntfs(*mfp);
   }
   XFREE(cp->mp->am_mfarray);
-  cp->mp->am_mfarray = 0;
   XFREE(cp);
 }
 
@@ -1073,7 +1072,7 @@ amfs_generic_mount_child(am_node *new_mp, int *error_return)
 
   /* we have an errorfs attached to the am_node, free it */
   free_mntfs(new_mp->am_mnt);
-  new_mp->am_mnt = 0;
+  new_mp->am_mnt = NULL;
 
   /*
    * Construct a continuation
index 36904b6ef782aa80fca53d11157e8e71d7d48083..75e1f0f464928d8d4cf72e8b973b1d0bec5cff0f 100644 (file)
@@ -303,8 +303,8 @@ amfs_host_mount(am_node *am, mntfs *mf)
   int n_export;
   int j, k;
   exports exlist = 0, ex;
-  exports *ep = 0;
-  am_nfs_handle_t *fp = 0;
+  exports *ep = NULL;
+  am_nfs_handle_t *fp = NULL;
   char *host;
   int error = 0;
   struct sockaddr_in sin;
@@ -449,13 +449,13 @@ amfs_host_mount(am_node *am, mntfs *mf)
     /* Check and avoid a duplicated export entry */
     if (j > k && ep[k] && STREQ(ep[j]->ex_dir, ep[k]->ex_dir)) {
       dlog("avoiding dup fhandle requested for %s", ep[j]->ex_dir);
-      ep[j] = 0;
+      ep[j] = NULL;
     } else {
       k = j;
       error = fetch_fhandle(client, ep[j]->ex_dir, &fp[j],
                            mf->mf_server->fs_version);
       if (error)
-       ep[j] = 0;
+       ep[j] = NULL;
     }
   }
 
@@ -466,7 +466,7 @@ amfs_host_mount(am_node *am, mntfs *mf)
    * the last error code.
    */
   xstrlcpy(fs_name, mf->mf_info, MAXPATHLEN);
-  if ((rfs_dir = strchr(fs_name, ':')) == (char *) 0) {
+  if ((rfs_dir = strchr(fs_name, ':')) == (char *) NULL) {
     plog(XLOG_FATAL, "amfs_host_mount: mf_info has no colon");
     error = EINVAL;
     goto out;
@@ -548,7 +548,7 @@ amfs_host_umount(am_node *am, mntfs *mf)
    * Reverse list...
    */
   ml = mlist;
-  mprev = 0;
+  mprev = NULL;
   while (ml) {
     mntlist *ml2 = ml->mnext;
     ml->mnext = mprev;
index 1443f6ca9fe22ff170dd1446be6d80be08df93e2..8d5072fe3d896fc4cea79ed4f730f53450f19faf 100644 (file)
@@ -149,7 +149,7 @@ amfs_nfsx_match(am_opts *fo)
   /*
    * Determine magic cookie to put in mtab
    */
-  xmtab = str3cat((char *) 0, fo->opt_rhost, ":", fo->opt_rfs);
+  xmtab = str3cat((char *) NULL, fo->opt_rhost, ":", fo->opt_rfs);
   dlog("NFSX: mounting remote server \"%s\", remote fs \"%s\" on \"%s\"",
        fo->opt_rhost, fo->opt_rfs, fo->opt_fs);
 
@@ -190,7 +190,7 @@ amfs_nfsx_init(mntfs *mf)
 
   if (nx == 0) {
     char **ivec;
-    char *info = 0;
+    char *info = NULL;
     char *host;
     char *pref;
     int error = 0;
@@ -221,12 +221,12 @@ amfs_nfsx_init(mntfs *mf)
 
     nx->nx_c = i - 1;          /* i-1 because we don't want the prefix */
     nx->nx_v = (amfs_nfsx_mnt *) xmalloc(nx->nx_c * sizeof(amfs_nfsx_mnt));
-    nx->nx_mp = 0;
+    nx->nx_mp = NULL;
     {
-      char *mp = 0;
-      char *xinfo = 0;
+      char *mp = NULL;
+      char *xinfo = NULL;
       char *fs = mf->mf_fo->opt_fs;
-      char *rfs = 0;
+      char *rfs = NULL;
       for (i = 0; i < nx->nx_c; i++) {
        char *path = ivec[i + 1];
        rfs = str3cat(rfs, pref, "/", path);
@@ -503,7 +503,7 @@ amfs_nfsx_umount(am_node *am, mntfs *mf)
        }
       }
       free_mntfs(m);
-      n->n_mnt = 0;
+      n->n_mnt = NULL;
       n->n_error = -1;
     }
   }
index 7a4215105b083d33d19b916bea1ce81af18fd66a..e439c2700acf046ff6bd89749106c8222072e538 100644 (file)
@@ -158,7 +158,7 @@ strsplit(char *s, int ch, int qc)
   if (amuDebug(D_STR))
     plog(XLOG_DEBUG, "strsplit saved a total of %d strings", ic);
 
-  ivec[ic] = 0;
+  ivec[ic] = NULL;
 
   return ivec;
 }
index f9998abc07a0fcc2701788be7717072994712c6a..7ba570c336cb40fd337e8fe525a2b174fa150c5a 100644 (file)
@@ -74,13 +74,13 @@ fgets_timed(char *s, int size, int rdfd, int secs)
   if (!s || size < 0 || rdfd < 0)
     return 0;
 
-  s[0] = 0;
+  s[0] = '\0';
   if (size == 0)
     return s;
 
   start = clocktime();
   while (s[i] != '\n'  &&  i < size-1) {
-    s[i+1] = 0; /* places the requisite trailing '\0' */
+    s[i+1] = '\0'; /* places the requisite trailing '\0' */
 
     /* ready for reading */
     rval = read(rdfd, (void *)(s+i), 1);
@@ -114,7 +114,7 @@ fgets_timed(char *s, int size, int rdfd, int secs)
     FD_ZERO(&fds);
     FD_SET(rdfd, &fds);
 
-    rval = select(rdfd+1, &fds, 0, 0, &timeo);
+    rval = select(rdfd+1, &fds, NULL, NULL, &timeo);
     if (rval < 0) {
       /* error selecting */
       plog(XLOG_WARNING, "fgets_timed select error: %m");
@@ -167,7 +167,7 @@ read_line(char *buf, int size, int fd)
 static int
 exec_parse_qanswer(mnt_map *m, int fd, char *map, char *key, char **pval, time_t *tp)
 {
-  char qanswer[INFO_MAX_LINE_LEN], *dc = 0;
+  char qanswer[INFO_MAX_LINE_LEN], *dc = NULL;
   int chuck = 0;
   int line_no = 0;
 
@@ -326,7 +326,7 @@ exec_map_open(char *emap, char *key)
   close(pdes[1]);
 
   /* anti-zombie insurance */
-  while (waitpid(p1,0,0) < 0)
+  while (waitpid(p1, 0, 0) < 0)
     if (errno != EINTR)
       exit(errno);
 
index f2bf1fb3e31e289f2d367143159b9b05564c0dc2..8add8aafecd72f5b26da15acbec9235d04b7ebc3 100644 (file)
@@ -94,7 +94,7 @@ passwd_init(mnt_map *m, char *map, time_t *tp)
 int
 passwd_search(mnt_map *m, char *map, char *key, char **pval, time_t *tp)
 {
-  char *dir = 0;
+  char *dir = NULL;
   struct passwd *pw;
 
   if (STREQ(key, "/defaults")) {
index 47279debab41dea3a766392065f7ce31f21f8022..11578069f2ecbd4b237465a641a4b0a5d94b1473 100644 (file)
--- a/amd/map.c
+++ b/amd/map.c
@@ -69,7 +69,7 @@ static u_int am_gen = 2;      /* Initial generation number */
 static int timeout_mp_id;      /* Id from last call to timeout */
 
 static am_node *root_node;     /* The root of the mount tree */
-static am_node **exported_ap = (am_node **) 0;
+static am_node **exported_ap = (am_node **) NULL;
 static int exported_ap_size = 0;
 static int first_free_map = 0; /* First available free slot */
 static int last_used_map = -1; /* Last unavailable used slot */
@@ -280,7 +280,7 @@ exported_ap_free(am_node *mp)
   /*
    * Zero the slot pointer to avoid double free's
    */
-  exported_ap[mp->am_mapno] = 0;
+  exported_ap[mp->am_mapno] = NULL;
 
   /*
    * Update the free and last_used indices
@@ -410,12 +410,12 @@ init_map(am_node *mp, char *dir)
    * other fields don't need to be set to zero.
    */
   mp->am_mnt = new_mntfs();
-  mp->am_mfarray = 0;
+  mp->am_mfarray = NULL;
   mp->am_name = strdup(dir);
   mp->am_path = strdup(dir);
   mp->am_gen = new_gen();
 #ifdef HAVE_FS_AUTOFS
-  mp->am_autofs_fh = 0;
+  mp->am_autofs_fh = NULL;
 #endif /* HAVE_FS_AUTOFS */
 
   mp->am_timeo = gopt.am_timeo;
@@ -660,7 +660,7 @@ make_root_node(void)
   /*
    * Allocate a new mounted filesystem
    */
-  root_mnt = find_mntfs(&amfs_root_ops, (am_opts *) 0, "", rootmap, "", "", "");
+  root_mnt = find_mntfs(&amfs_root_ops, (am_opts *) NULL, "", rootmap, "", "", "");
 
   /*
    * Replace the initial null reference
@@ -738,7 +738,7 @@ umount_exported(void)
       } else {
        am_unmounted(mp);
       }
-      exported_ap[i] = 0;
+      exported_ap[i] = NULL;
     } else {
       /*
        * Any other node gets forcibly timed out.
@@ -1052,7 +1052,7 @@ timeout_mp(opaque_t v)                            /* argument not used?! */
     t = now + 1;
   dlog("Next mount timeout in %lds", (long) (t - now));
 
-  timeout_mp_id = timeout(t - now, timeout_mp, 0);
+  timeout_mp_id = timeout(t - now, timeout_mp, NULL);
 }
 
 
@@ -1064,5 +1064,5 @@ reschedule_timeout_mp(void)
 {
   if (timeout_mp_id)
     untimeout(timeout_mp_id);
-  timeout_mp_id = timeout(0, timeout_mp, 0);
+  timeout_mp_id = timeout(0, timeout_mp, NULL);
 }
index f95412cf56e0317e8362c6f82f161246b5675ecd..00b6d313f3bcf0c5b808b8c4ed372020154279b3 100644 (file)
@@ -96,7 +96,7 @@ static struct opt_tab mapc_opt[] =
   {"regexp", MAPC_RE},
 #endif /* HAVE_REGEXEC */
   {"sync", MAPC_SYNC},
-  {0, 0}
+  {NULL, 0}
 };
 
 /*
@@ -522,7 +522,7 @@ mapc_find_wildcard(mnt_map *m)
   int rc = search_map(m, wildcard, &m->wildcard);
 
   if (rc != 0)
-    m->wildcard = 0;
+    m->wildcard = NULL;
 }
 
 
@@ -582,12 +582,12 @@ mapc_reload_map(mnt_map *m)
     memcpy((voidp) m->kvhash, (voidp) tmphash, sizeof(m->kvhash));
     m->modify = t;
   }
-  m->wildcard = 0;
+  m->wildcard = NULL;
 
   dlog("calling mapc_search for wildcard");
   error = mapc_search(m, wildcard, &m->wildcard);
   if (error)
-    m->wildcard = 0;
+    m->wildcard = NULL;
 }
 
 
@@ -693,7 +693,7 @@ mapc_create(char *map, char *opt, const char *type)
   memset((voidp) m->kvhash, 0, sizeof(m->kvhash));
   m->map_name = strdup(map);
   m->refc = 1;
-  m->wildcard = 0;
+  m->wildcard = NULL;
   m->reloads = 0;
   /* Unfortunately with current code structure, this cannot be initialized here */
   m->cfm = NULL;
@@ -739,10 +739,8 @@ mapc_clear(mnt_map *m)
   /*
    * Free the wildcard if it exists
    */
-  if (m->wildcard) {
+  if (m->wildcard)
     XFREE(m->wildcard);
-    m->wildcard = 0;
-  }
 }
 
 
@@ -801,7 +799,7 @@ static int
 mapc_meta_search(mnt_map *m, char *key, char **pval, int recurse)
 {
   int error = 0;
-  kv *k = 0;
+  kv *k = NULL;
 
   /*
    * Firewall
@@ -852,7 +850,7 @@ mapc_meta_search(mnt_map *m, char *key, char **pval, int recurse)
        int retval;
 
        /* XXX: this code was recently ported, and must be tested -Erez */
-       retval = regexec(&k->re, key, 0, 0, 0);
+       retval = regexec(&k->re, key, 0, NULL, 0);
        if (retval == 0) {      /* succeeded */
          break;
        } else {                /* failed to match, log error */
@@ -919,7 +917,7 @@ mapc_meta_search(mnt_map *m, char *key, char **pval, int recurse)
        dlog("mapc recurses on %s", wildname);
        error = mapc_meta_search(m, wildname, pval, MREC_PART);
        if (error)
-         *subp = 0;
+         *subp = '\0';
       }
 
       if (error > 0 && m->wildcard) {
index f51bfcafe2aab96194b1f3bf9272030b9b58369d..21d1bbad89d5a5b21257cb758d5c9b916693e9ce 100644 (file)
@@ -82,13 +82,13 @@ init_mntfs(mntfs *mf, am_ops *ops, am_opts *mo, char *mp, char *info, char *auto
   mf->mf_flags = 0;
   mf->mf_error = -1;
   mf->mf_cid = 0;
-  mf->mf_private = 0;
-  mf->mf_prfree = 0;
+  mf->mf_private = NULL;
+  mf->mf_prfree = NULL;
 
   if (ops->ffserver)
     mf->mf_server = (*ops->ffserver) (mf);
   else
-    mf->mf_server = 0;
+    mf->mf_server = NULL;
 }
 
 
@@ -171,7 +171,7 @@ locate_mntfs(am_ops *ops, am_opts *mo, char *mp, char *info, char *auto_opts, ch
 
        if (mf->mf_private && mf->mf_prfree) {
          mf->mf_prfree(mf->mf_private);
-         mf->mf_private = 0;
+         mf->mf_private = NULL;
        }
 
        fs = ops->ffserver ? (*ops->ffserver) (mf) : (fserver *) NULL;
@@ -202,7 +202,7 @@ find_mntfs(am_ops *ops, am_opts *mo, char *mp, char *info, char *auto_opts, char
 mntfs *
 new_mntfs(void)
 {
-  return alloc_mntfs(&amfs_error_ops, (am_opts *) 0, "//nil//", ".", "", "", "");
+  return alloc_mntfs(&amfs_error_ops, (am_opts *) NULL, "//nil//", ".", "", "", "");
 }
 
 
index f9acb97e30d5c5ad1e6765a139adceeabe08ad85..193bb7fc734905de2bf271e4e26668176f17c4b1 100644 (file)
@@ -65,12 +65,11 @@ u_short nfs_port = 0;
 static void
 checkup(void)
 {
-
   static int max_fd = 0;
-  static char *max_mem = 0;
-
+  static char *max_mem = NULL;
   int next_fd = dup(0);
   caddr_t next_mem = sbrk(0);
+
   close(next_fd);
 
   if (max_fd < next_fd) {
@@ -139,8 +138,8 @@ do_select(int smask, int fds, fd_set *fdp, struct timeval *tvp)
     /*
      * Wait for input
      */
-    nsel = select(fds, fdp, (fd_set *) 0, (fd_set *) 0,
-                 tvp->tv_sec ? tvp : (struct timeval *) 0);
+    nsel = select(fds, fdp, (fd_set *) NULL, (fd_set *) NULL,
+                 tvp->tv_sec ? tvp : (struct timeval *) NULL);
   }
 
 #ifdef HAVE_SIGACTION
@@ -175,7 +174,7 @@ rpc_pending_now(void)
   FD_SET(fwd_sock, &readfds);
 
   tvv.tv_sec = tvv.tv_usec = 0;
-  nsel = select(FD_SETSIZE, &readfds, (fd_set *) 0, (fd_set *) 0, &tvv);
+  nsel = select(FD_SETSIZE, &readfds, (fd_set *) NULL, (fd_set *) NULL, &tvv);
   if (nsel < 1)
     return (0);
   if (FD_ISSET(fwd_sock, &readfds))
index 94e2547ae3ed1c4c4f2c68b5a8334d1df855c41a..b03173e424311a4445fcebe582cb7053debea4c2 100644 (file)
@@ -632,7 +632,7 @@ static am_node *
 fh_to_mp3(am_nfs_fh *fhp, int *rp, int vop)
 {
   struct am_fh *fp = (struct am_fh *) fhp;
-  am_node *ap = 0;
+  am_node *ap = NULL;
 
   if (fp->u.s.fhh_type != 0) {
     /* New filehandle type */
@@ -672,7 +672,7 @@ fh_to_mp3(am_nfs_fh *fhp, int *rp, int vop)
    * a new one allocated.
    */
   if (ap != NULL && ap->am_gen != fp->fhh_gen)
-    ap = 0;
+    ap = NULL;
 
   /*
    * If it doesn't exists then drop the request
@@ -712,7 +712,7 @@ fh_to_mp3(am_nfs_fh *fhp, int *rp, int vop)
       if (ap && error < 0)
        ap = orig_ap->am_parent->am_mnt->mf_ops->mount_child(ap, &error);
     } else {
-      ap = 0;
+      ap = NULL;
       error = ESTALE;
     }
     if (ap == 0) {
@@ -731,7 +731,7 @@ fh_to_mp3(am_nfs_fh *fhp, int *rp, int vop)
     new_ttl(orig_ap);
 
   }
-#endif
+#endif /* 0 */
 
   /*
    * Disallow references to objects being unmounted, unless
index e447bbfdbfdfb547ce39bbfd86635378070ad464..dd85fefd59850f1652c1ba414a4674bc7347cbd3 100644 (file)
@@ -145,7 +145,7 @@ am_ops nfs_ops =
 static fh_cache *
 find_nfs_fhandle_cache(opaque_t arg, int done)
 {
-  fh_cache *fp, *fp2 = 0;
+  fh_cache *fp, *fp2 = NULL;
   int id = (long) arg;         /* for 64-bit archs */
 
   ITER(fp, fh_cache, &fh_head) {
@@ -338,7 +338,7 @@ discard_fh(opaque_t arg)
 static int
 prime_nfs_fhandle_cache(char *path, fserver *fs, am_nfs_handle_t *fhbuf, mntfs *mf)
 {
-  fh_cache *fp, *fp_save = 0;
+  fh_cache *fp, *fp_save = NULL;
   int error;
   int reuse_id = FALSE;
 
@@ -605,7 +605,7 @@ webnfs_lookup(fh_cache *fp, fwd_fun fun, wchan_t wchan)
   nfsdiropargs args;
 #ifdef HAVE_FS_NFS3
   am_LOOKUP3args args3;
-#endif
+#endif /* HAVE_FS_NFS3 */
   char *wnfs_path;
 
   if (!nfs_auth) {
@@ -1030,8 +1030,8 @@ nfs_umounted(mntfs *mf)
     f.fh_fs = fs;
     f.fh_id = 0;
     f.fh_error = 0;
-    prime_nfs_fhandle_cache(colon + 1, mf->mf_server, (am_nfs_handle_t *) 0, mf);
-    call_mountd(&f, MOUNTPROC_UMNT, (fwd_fun *) 0, (wchan_t) 0);
+    prime_nfs_fhandle_cache(colon + 1, mf->mf_server, (am_nfs_handle_t *) NULL, mf);
+    call_mountd(&f, MOUNTPROC_UMNT, (fwd_fun *) NULL, (wchan_t) NULL);
     *colon = ':';
   }
 }
index f6123e1ff30bcb0f5644d960a3ef139ada1ea6d8..45a587f7980f3cecb54d501a02dd50f714b4bd7e 100644 (file)
@@ -998,7 +998,7 @@ normalize_slash(char *p)
       /* assert(*f == 0 || *f == '/'); */
 
     } while (*f);
-    *t = 0;                    /* derived from fix by Steven Glassman */
+    *t = '\0';                 /* derived from fix by Steven Glassman */
   }
 }
 
index c106f8e6eb4d5da207d0c53da5b75863e3a9e0eb..4a79d37b3bcc26c2a5c4129b4565dfc3819dad2f 100644 (file)
@@ -170,7 +170,7 @@ make_entry_chain(am_node *mp, const nfsentry *current_chain, int fully_browsable
        /* out of space */
        plog(XLOG_DEBUG, "make_entry_chain: no more space in chain");
        if (num_entries > 0) {
-         chain[num_entries - 1].ne_nextentry = 0;
+         chain[num_entries - 1].ne_nextentry = NULL;
          retval = &chain[0];
        }
        return retval;
@@ -190,7 +190,7 @@ make_entry_chain(am_node *mp, const nfsentry *current_chain, int fully_browsable
 
   /* terminate chain */
   if (num_entries > 0) {
-    chain[num_entries - 1].ne_nextentry = 0;
+    chain[num_entries - 1].ne_nextentry = NULL;
     retval = &chain[0];
   }
 
@@ -262,7 +262,7 @@ amfs_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *
       ep[1].ne_fileid = mp->am_gen;
 
     ep[1].ne_name = "..";
-    ep[1].ne_nextentry = 0;
+    ep[1].ne_nextentry = NULL;
     *(u_int *) ep[1].ne_cookie = DOT_DOT_COOKIE;
 
     /*
@@ -313,7 +313,7 @@ amfs_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *
   if (gen == DOT_DOT_COOKIE) {
     dlog("amfs_readdir_browsable: End of readdir in %s", mp->am_path);
     dp->dl_eof = TRUE;
-    dp->dl_entries = 0;
+    dp->dl_entries = NULL;
     return 0;
   }
 
@@ -327,7 +327,7 @@ amfs_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *
 
   te = te_next;                        /* reset 'te' from last saved te_next */
   if (!te) {                   /* another indicator of end of readdir */
-    dp->dl_entries = 0;
+    dp->dl_entries = NULL;
     return 0;
   }
   /*
@@ -420,7 +420,7 @@ amfs_generic_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep
     else
       ep[1].ne_fileid = mp->am_gen;
     ep[1].ne_name = "..";
-    ep[1].ne_nextentry = 0;
+    ep[1].ne_nextentry = NULL;
     *(u_int *) ep[1].ne_cookie = (xp ? xp->am_gen : DOT_DOT_COOKIE);
 
     if (!xp)
@@ -440,7 +440,7 @@ amfs_generic_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep
   if (gen == DOT_DOT_COOKIE) {
     dlog("amfs_generic_readdir: End of readdir in %s", mp->am_path);
     dp->dl_eof = TRUE;
-    dp->dl_entries = 0;
+    dp->dl_entries = NULL;
     if (amuDebug(D_READDIR))
       plog(XLOG_DEBUG, "end of readdir eof=TRUE, dl_entries=0\n");
     return 0;
@@ -483,7 +483,7 @@ amfs_generic_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep
       }
     } while (todo > 0);
 
-    ep->ne_nextentry = 0;
+    ep->ne_nextentry = NULL;
 
     if (amuDebug(D_READDIR)) {
       nfsentry *ne;
index 88fd46b42690b0947704512e8d2155100e56e310..e17945fb70a7cf46ec7fb586cefdbe950e686515 100644 (file)
@@ -59,8 +59,8 @@ restart_fake_mntfs(mntent_t *me, am_ops *fs_ops)
    * Partially fake up an opts structure
    */
   memset(&mo, 0, sizeof(mo));
-  mo.opt_rhost = 0;
-  mo.opt_rfs = 0;
+  mo.opt_rhost = NULL;
+  mo.opt_rfs = NULL;
   cp = strchr(me->mnt_fsname, ':');
   if (cp) {
     *cp = '\0';
@@ -87,7 +87,7 @@ restart_fake_mntfs(mntent_t *me, am_ops *fs_ops)
   if (mf->mf_refc == 1) {
     mf->mf_flags |= MFF_RESTART | MFF_MOUNTED;
     mf->mf_error = 0;               /* Already mounted correctly */
-    mf->mf_fo = 0;
+    mf->mf_fo = NULL;
     /*
      * Only timeout non-NFS entries
      */
@@ -140,7 +140,7 @@ restart(void)
        mlp;
        mlp = mlp->mnext) {
     mntent_t *me = mlp->mnt;
-    am_ops *fs_ops = 0;
+    am_ops *fs_ops = NULL;
 
     if (STREQ(me->mnt_type, MNTTAB_TYPE_NFS)) {
       /*
@@ -203,7 +203,7 @@ restart_automounter_nodes(void)
        mlp;
        mlp = mlp->mnext) {
     mntent_t *me = mlp->mnt;
-    am_ops *fs_ops = 0;
+    am_ops *fs_ops = NULL;
     char *colon;
     long pid;
     u_short port;
index ae7aa0e46abcd206bb81c8d7f038404f00d1c5fc..ffd9031e09a68f5cf94d83db48c99fa9aca6c74b 100644 (file)
@@ -94,7 +94,7 @@ static rpc_forward *
 fwd_alloc(void)
 {
   time_t now = clocktime();
-  rpc_forward *p = 0, *p2;
+  rpc_forward *p = NULL, *p2;
 
   /*
    * First search for an existing expired one.
@@ -183,7 +183,7 @@ fwd_init(void)
   /*
    * Some things we talk to require a priv port - so make one here
    */
-  if (bind_resv_port(fwd_sock, (u_short *) 0) < 0)
+  if (bind_resv_port(fwd_sock, (u_short *) NULL) < 0)
     plog(XLOG_ERROR, "can't bind privileged port (rpc_fwd)");
 
   if (fcntl(fwd_sock, F_SETFL, FNDELAY) < 0
index 940bc347b703385dd481d7bb636146c83de0e9b3..4f973a470b0210778eb1805ba80b1bc18cb97c26 100644 (file)
@@ -262,7 +262,7 @@ sigchld(int sig)
 #ifdef HAVE_WAITPID
   while ((pid = waitpid((pid_t) -1,  &w, WNOHANG)) > 0) {
 #else /* not HAVE_WAITPID */
-  while ((pid = wait3( &w, WNOHANG, (struct rusage *) 0)) > 0) {
+  while ((pid = wait3( &w, WNOHANG, (struct rusage *) NULL)) > 0) {
 #endif /* not HAVE_WAITPID */
     pjob *p, *p2;
 
index 5f10b909ed31ecea7277884afa587279d316841e..c49c9814dbc37dba06d3cc9f193ca687c20e67f9 100644 (file)
@@ -70,13 +70,13 @@ amfs_generic_find_srvr(mntfs *mf)
     fs = ALLOC(struct fserver);
     fs->fs_refc = 0;
     fs->fs_host = strdup("localhost");
-    fs->fs_ip = 0;
+    fs->fs_ip = NULL;
     fs->fs_cid = 0;
     fs->fs_pinger = AM_PINGER;
     fs->fs_flags = FSF_VALID | FSF_PING_UNINIT;
     fs->fs_type = "local";
-    fs->fs_private = 0;
-    fs->fs_prfree = 0;
+    fs->fs_private = NULL;
+    fs->fs_prfree = NULL;
 
     ins_que(&fs->fs_q, &amfs_auto_srvr_list);
 
index a1355b92f9b6062f91d620a2e6a2b9e74e32e7a6..dae83f1a3eb836cb8fcb34c33393c75df39e613e 100644 (file)
@@ -184,7 +184,7 @@ static void
 got_portmap(voidp pkt, int len, struct sockaddr_in *sa, struct sockaddr_in *ia, voidp idv, int done)
 {
   fserver *fs2 = (fserver *) idv;
-  fserver *fs = 0;
+  fserver *fs = NULL;
 
   /*
    * Find which fileserver we are talking about
@@ -474,7 +474,7 @@ check_fs_addr_change(fserver *fs)
 #if 0
   flush_nfs_fhandle_cache(fs); /* done in caller: nfs_keepalive_timeout */
   /* XXX: need to purge nfs_private so that somehow it will get re-initialized? */
-#endif
+#endif /* 0 */
 }
 
 
@@ -577,7 +577,7 @@ nfs_keepalive(voidp v)
                     ping_buf[fs->fs_version - NFS_VERSION],
                     ping_len[fs->fs_version - NFS_VERSION],
                     fs->fs_ip,
-                    (struct sockaddr_in *) 0,
+                    (struct sockaddr_in *) NULL,
                     (voidp) ((long) np->np_xid), /* cast needed for 64-bit archs */
                     nfs_keepalive_callback);
 
index 16bee0a9dbb2308f45471abe2d4907a2ba505d6f..11b680f6b781d7a3c969b31218ac106b5e6e647b 100644 (file)
@@ -93,8 +93,10 @@ static void hash_init(void)
   list = malloc(autofs_max_fds * sizeof(*list));
   hash = malloc(autofs_max_fds * sizeof(*hash));
 
-  for (i = 0 ; i < autofs_max_fds; i++)
-    hash[i] = 0, list[i] = -1;
+  for (i = 0 ; i < autofs_max_fds; i++) {
+    hash[i] = NULL;
+    list[i] = -1;
+  }
 }
 
 
@@ -116,7 +118,7 @@ static void hash_delete(int fd)
   if (hash[fd] == 0)
     plog(XLOG_WARNING, "file descriptor %d not in the hash", fd);
 
-  hash[fd] = 0;
+  hash[fd] = NULL;
   numfds--;
   for (i = 0; i < numfds; i++)
     if (list[i] == fd) {
index 34bfde11c0bf84363ae5bcc904d143664fb9272f..0ce1dcf87d360490b3575f8d1a839b8841157bea 100644 (file)
@@ -62,7 +62,7 @@ int
 fixmount_check_mount(char *host, struct in_addr hostaddr, char *path)
 {
   int ret, i;
-  char *mntinfo = 0, *cp;
+  char *mntinfo = NULL, *cp;
   char *short_hostname, *long_hostname, *mount_point;
   struct vmount *vp;
 
index 8ce3b9e74e8b5f3d1e045d171f5b8f7a91754e60..f7c3639f5c2665a930cb85d490cb7963ea7d4fae 100644 (file)
@@ -213,7 +213,7 @@ do_opts:
   if (strlen(*xopts))
     *(*xopts + strlen(*xopts)-1) = '\0';
   if (strlen(topts))
-    topts[strlen(topts)-1] = 0;
+    topts[strlen(topts)-1] = '\0';
   XFREE(xoptstr);
   return topts;
 }
@@ -321,7 +321,7 @@ mount_linux_nfs(MTYPE_TYPE type, mntent_t *mnt, int flags, caddr_t data)
     plog(XLOG_ERROR, "Can't create socket for kernel");
     return 1;
   }
-  if (bindresvport(mnt_data->fd, 0) < 0) {
+  if (bindresvport(mnt_data->fd, NULL) < 0) {
     plog(XLOG_ERROR, "Can't bind to reserved port");
     errorcode = 1;
     goto out;
@@ -746,7 +746,7 @@ find_unused_loop_device(void)
 
 #define LOOP_FMT_SIZE(a) (sizeof(a)/sizeof(a[0]))
   for (j = 0; j < (int) LOOP_FMT_SIZE(loop_formats); j++) {
-    for(i = 0; i < 256; i++) {
+    for (i = 0; i < 256; i++) {
       sprintf(dev, loop_formats[j], i);
       if (stat(dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)) {
        somedev++;
index 506aa86d536253baac79c8c50e0b5b8060fe12a8..2b79fb24f37a32b2dc13ed849851a593fff1a452 100644 (file)
@@ -82,7 +82,7 @@ mnt_dup(struct vmount *mp)
 
   case MOUNT_TYPE_NFS:
     ty = MNTTAB_TYPE_NFS;
-    new_mp->mnt_fsname = str3cat((char *) 0,
+    new_mp->mnt_fsname = str3cat((char *) NULL,
                                 vmt2dataptr(mp, VMT_HOSTNAME), ":",
                                 fsname);
     break;
@@ -90,7 +90,7 @@ mnt_dup(struct vmount *mp)
 #ifdef HAVE_FS_NFS3
   case MOUNT_TYPE_NFS3:
     ty = MNTTAB_TYPE_NFS3;
-    new_mp->mnt_fsname = str3cat((char *) 0,
+    new_mp->mnt_fsname = str3cat((char *) NULL,
                                 vmt2dataptr(mp, VMT_HOSTNAME), ":",
                                 fsname);
     break;
@@ -122,7 +122,7 @@ read_mtab(char *fs, const char *mnttabname)
 {
   mntlist **mpp, *mhp;
   int i;
-  char *mntinfo = 0, *cp;
+  char *mntinfo = NULL, *cp;
   struct vmount *vp;
   int ret;
   int maxtry = 10;             /* maximum number of times to try mntctl */
@@ -173,7 +173,7 @@ read_mtab(char *fs, const char *mnttabname)
     mpp = &(*mpp)->mnext;
   }
 
-  *mpp = 0;
+  *mpp = NULL;
 
 out:
   if (mntinfo)
index 199ced96b365b7588249cee2120a2f7a9aa8c9c9..d47db877424c44c371a71064545d8e7d0aa59471 100644 (file)
@@ -138,7 +138,7 @@ read_mtab(char *fs, const char *mnttabname)
   /*
    * Terminate the list
    */
-  *mpp = 0;
+  *mpp = NULL;
 
   return mhp;
 }
index 4d2201ed3f6e13fd33d0bc4c21bddb34f5788d4c..0a97109c6d85e74aa0a78657570058706359fd6a 100644 (file)
@@ -97,7 +97,7 @@ again:
 static FILE *
 open_locked_mtab(const char *mnttabname, char *mode, char *fs)
 {
-  FILE *mfp = 0;
+  FILE *mfp = NULL;
 
   /*
    * There is a possible race condition if two processes enter
@@ -122,12 +122,12 @@ open_locked_mtab(const char *mnttabname, char *mode, char *fs)
     dlog("Forced close on %s in read_mtab", mnttabname);
 # endif /* DEBUG */
     endmntent(mnt_file);
-    mnt_file = 0;
+    mnt_file = NULL;
   }
 again:
   if (mfp) {
     endmntent(mfp);
-    mfp = 0;
+    mfp = NULL;
   }
   clock_valid = 0;
   if (stat(mnttabname, &st_before) < 0) {
@@ -231,7 +231,7 @@ unlock_mntlist(void)
   if (mnt_file) {
     dlog("unlock_mntlist: releasing");
     endmntent(mnt_file);
-    mnt_file = 0;
+    mnt_file = NULL;
   }
 }
 
@@ -442,7 +442,7 @@ read_mtab(char *fs, const char *mnttabname)
      */
     mpp = &(*mpp)->mnext;
   }
-  *mpp = 0;
+  *mpp = NULL;
 
 #ifdef MOUNT_TABLE_ON_FILE
   /*
index 81c109c335a06aa47147d9cfe919642bd5b2449b..dcc78f150be12849dde537c8fa355f2524d63754 100644 (file)
@@ -170,12 +170,12 @@ read_mtab(char *fs, const char *mnttabname)
   int nmts;
 
   if (lockmnttab() != 0)
-    return (mntlist *) 0;
+    return (mntlist *) NULL;
 
   fd = open(mnttabname, O_RDONLY);
   if (fd < 0) {
     plog(XLOG_ERROR, "Can't open %s: %m", mnttabname);
-    return (mntlist *) 0;
+    return (mntlist *) NULL;
   }
   mpp = &mhp;
   while ((ret = read(fd, (char *) mountbuffer, NMOUNT * sizeof(mntent_t))) > 0) {
@@ -200,9 +200,9 @@ read_mtab(char *fs, const char *mnttabname)
   if (ret < 0) {
     plog(XLOG_ERROR, "read error on %s: %m", mnttabname);
     unlockmnttab();
-    mhp = (mntlist *) 0;
+    mhp = (mntlist *) NULL;
   }
-  *mpp = 0;
+  *mpp = NULL;
 
   close(fd);
   return mhp;
index bb183731441e6f13e6a5ad860b0d95939e17289f..704b6b5866b269a6cf391f8ee2b4c6122ed7549c 100644 (file)
@@ -276,12 +276,12 @@ lock_mtab(void)
 static FILE *
 open_locked_mtab(const char *mnttabname, char *mode, char *fs)
 {
-  FILE *mfp = 0;
+  FILE *mfp = NULL;
 
   if (mnt_file) {
     dlog("Forced close on %s in read_mtab", mnttabname);
     endmntent(mnt_file);
-    mnt_file = 0;
+    mnt_file = NULL;
   }
 
   if (!mtab_is_a_symlink() &&
@@ -309,7 +309,7 @@ unlock_mntlist(void)
     dlog("unlock_mntlist: releasing");
   if (mnt_file) {
     endmntent(mnt_file);
-    mnt_file = 0;
+    mnt_file = NULL;
   }
   if (we_created_lockfile) {
     close(lockfile_fd);
@@ -537,7 +537,7 @@ read_mtab(char *fs, const char *mnttabname)
      */
     mpp = &(*mpp)->mnext;
   }
-  *mpp = 0;
+  *mpp = NULL;
 
 #ifdef MOUNT_TABLE_ON_FILE
   /*
index 51d9790fb42d076d2b1cf2c127c21a7a18f4e70e..faa3f150c6e6418e6be97d1132811f770a0f06c3 100644 (file)
@@ -95,7 +95,7 @@ again:
 static FILE *
 open_locked_mtab(char *mnttabname, char *mode, char *fs)
 {
-  FILE *mfp = 0;
+  FILE *mfp = NULL;
 
   /*
    * There is a possible race condition if two processes enter
@@ -120,12 +120,12 @@ open_locked_mtab(char *mnttabname, char *mode, char *fs)
     dlog("Forced close on %s in read_mtab", mnttabname);
 #endif /* DEBUG */
     endmntent(mnt_file);
-    mnt_file = 0;
+    mnt_file = NULL;
   }
 again:
   if (mfp) {
     endmntent(mfp);
-    mfp = 0;
+    mfp = NULL;
   }
   clock_valid = 0;
   if (stat(mnttabname, &st_before) < 0) {
@@ -227,7 +227,7 @@ unlock_mntlist(void)
   if (mnt_file) {
     dlog("unlock_mntlist: releasing");
     endmntent(mnt_file);
-    mnt_file = 0;
+    mnt_file = NULL;
   }
 }
 
@@ -493,7 +493,7 @@ read_mtab(char *fs, const char *mnttabname)
      */
     mpp = &(*mpp)->mnext;
   }
-  *mpp = 0;
+  *mpp = NULL;
 
   /*
    * If we are not updating the mount table then we
index 0581d7b1aac62604e4de16c3949269e67560ff5d..89faf76c52e1fea5f94a9ea2b21d03fd26deec38 100644 (file)
@@ -144,7 +144,7 @@ read_mtab(char *fs, const char *mnttabname)
   }
 
   /* terminate the linked list */
-  *mpp = 0;
+  *mpp = NULL;
 
   return mhp;
 }
index ae4e65dab623dbf88ba2d31a8834c4359815a6d7..69a729a5e58d4d67f66853dd508fd6b23a9d3d37 100644 (file)
@@ -254,7 +254,7 @@ read_mtab(char *fs, const char *mnttabname)
     unlockmnttab();
     mhp = NULL;
   }
-  *mpp = 0;
+  *mpp = NULL;
 
   fclose(fp);
   return mhp;
index d863f214d35b59d60f40531359e6b554c8a8052b..2e79c0ba930dbe01c351de28d552d76a6b90a303 100644 (file)
@@ -89,9 +89,7 @@ mntlist *
 read_mtab(char *fs, const char *mnttabname)
 {
   mntlist **mpp, *mhp;
-
   /* From: Piete Brooks <pb@cl.cam.ac.uk> */
-
   int loc = 0;
   struct fs_data mountbuffer[NMOUNT], *fs_data;
   int ret;
@@ -119,7 +117,7 @@ read_mtab(char *fs, const char *mnttabname)
     plog(XLOG_ERROR, "getmountent: %m");
     return 0;
   }
-  *mpp = 0;
+  *mpp = NULL;
 
   return mhp;
 }
index 7bddec9ed64e8bd3c926db164600808ff871e336..5f81a3d3ed6152a8a014c6d2770ad0baec1d2a24 100644 (file)
@@ -265,7 +265,7 @@ struct aix4_nfs_args {
   unsigned long u14;           /* ??? UNKNOWN ??? */
   struct pathcnf *pathconf;    /* pathconf */
 };
-#endif
+#endif /* 0 */
 
 /*
  * IBM is in dire need of taking a soft-eng class.
index 7e7d91414f229fe0edf99e6deb80def9b89241fe..6804aeb734a07fe003229be098a7103037b50299 100644 (file)
@@ -139,7 +139,7 @@ typedef writeargs nfswriteargs;
  */
 #if 0
 #define MOUNT_NFS3 MOUNT_NFS
-#endif
+#endif /* 0 */
 
 
 #endif /* not _AMU_NFS_PROT_H */
index 0a80a91a27dd5b0d28357c4fa3e6bd434b5dfc11..db2ebb470833e927e9ddca2503c8f56a1d111790 100644 (file)
@@ -329,7 +329,7 @@ struct nfs_args {
   char                  *fsname;        /* F/S name */
 #if 0
   struct pathcnf       *pathconf;      /* static pathconf kludge */
-#endif
+#endif /* 0 */
 };
 
 struct nfs_fh {
@@ -567,7 +567,7 @@ struct LOOKUP3resok {
 #if 0
        post_op_attr obj_attributes;
        post_op_attr dir_attributes;
-#endif
+#endif /* 0 */
 };
 typedef struct LOOKUP3resok LOOKUP3resok;
 
@@ -575,7 +575,7 @@ struct LOOKUP3resfail {
   int dummy;
 #if 0
        post_op_attr dir_attributes;
-#endif
+#endif /* 0 */
 };
 typedef struct LOOKUP3resfail LOOKUP3resfail;
 
index 2c68144921f8e21e53de034fe10878f983ebf10c..13b5593a3d3b0a834941b0868ee962684ea2f73b 100644 (file)
@@ -66,7 +66,7 @@ typedef int (*ypall_callback_fxn_t)(u_long, char *, int, char *, int, void *);
 #if 0
 /* this is right for 1.3beta */
 typedef int (*ypall_callback_fxn_t)(int, char *, int, char *, int, char *);
-#endif
+#endif /* 0 */
 #endif /* DEFINED_YPALL_CALLBACK_FXN_T */
 
 
index 929ecc92cd75f9d7c8665e0f5df5d53db08bab0e..44873678980965a270087ab147d339ec15e937d7 100644 (file)
@@ -54,7 +54,7 @@
 #if 0
 /* this is RIGHT for 1.2G and 1.2.1 */
 typedef int (*ypall_callback_fxn_t)(u_long, char *, int, char *, int, void *);
-#endif
+#endif /* 0 */
 /* this is right for 1.3beta and newer */
 typedef int (*ypall_callback_fxn_t)(int, char *, int, char *, int, char *);
 #endif /* DEFINED_YPALL_CALLBACK_FXN_T */
index 396e723fa8b1eb5cbe80ba5f4569af4a00269771..3d1650f590ca888e3337559b11a8e47822c6bca0 100644 (file)
@@ -74,7 +74,7 @@
 #if 0
 /* this is RIGHT for 1.2G and 1.2.1 */
 typedef int (*ypall_callback_fxn_t)(u_long, char *, int, char *, int, void *);
-#endif
+#endif /* 0 */
 /* this is right for 1.3beta and newer */
 typedef int (*ypall_callback_fxn_t)(int, char *, int, char *, int, char *);
 #endif /* DEFINED_YPALL_CALLBACK_FXN_T */
index aca16ca7419909ceac171beb53aade27cbb29ae3..a27266ac0bf429b5e394507fb5f3c1a93a9a6303 100644 (file)
@@ -70,7 +70,7 @@
 #if 0
 /* cannot include this file b/c it refers to non-existing headers */
 # include <bsd/nfs/nfs_mount.h>
-#endif
+#endif /* 0 */
 
 
 /*
index 89ea11d4044edc51e02cfb5831e2b9fb15a74334..95dd4df1e9ffbfcef0bff584b6074ff0f395f986 100644 (file)
@@ -355,7 +355,7 @@ struct _writeargs {
     char *wra_val_u;
   } wra_u;
 };
-#endif
+#endif /* 0 */
 
 struct nfscreateargs {
   nfsdiropargs ca_where;
index 6a41eee9285f948a4351bc30b376f247663d6303..410e371302b95b4492953aeb5744918690e4db2f 100644 (file)
@@ -364,7 +364,7 @@ struct _writeargs {
     char *wra_val_u;
   } wra_u;
 };
-#endif
+#endif /* 0 */
 
 struct nfscreateargs {
   nfsdiropargs ca_where;
index 3a339a6f0c9f280eb5564ead1fda79d01070b0f7..4434761c08fe4db7fc58fbc570ececdc77530334 100644 (file)
@@ -66,7 +66,7 @@
 /* defaults: libamu/amu.h */
 #define        MNTPATHLEN 1024
 #define        MNTNAMLEN 255
-#endif
+#endif /* 0 */
 
 #define NFSMODE_FMT 0170000
 #define NFSMODE_DIR 0040000
index 05b0550d245503406161d8911ffc75b435f6a041..e4a36c7931631488888efe8d300318837d7a535c 100644 (file)
@@ -177,7 +177,7 @@ get_mount_client(char *unused_host, struct sockaddr_in *sin, struct timeval *tv,
     /*
      * Bind to a privileged port
      */
-    if (bind_resv_port(*sock, (u_short *) 0) < 0)
+    if (bind_resv_port(*sock, (u_short *) NULL) < 0)
       plog(XLOG_ERROR, "can't bind privileged port (socket)");
 
     /*
@@ -204,7 +204,7 @@ get_mount_client(char *unused_host, struct sockaddr_in *sin, struct timeval *tv,
   /*
    * Bind to a privileged port
    */
-  if (bind_resv_port(*sock, (u_short *) 0) < 0)
+  if (bind_resv_port(*sock, (u_short *) NULL) < 0)
     plog(XLOG_ERROR, "can't bind privileged port");
 
   /*
index 12b9fd0bfad983570f1703315ec63b6c19927a6e..a90f8090ab2cfe099ada5f168aa9a18488c36f2b 100644 (file)
@@ -205,7 +205,7 @@ get_mount_client(char *host, struct sockaddr_in *unused_sin, struct timeval *tv,
     plog(XLOG_ERROR, "t_open %s: %m", nc->nc_device);
     goto tryudp;
   }
-  if (bind_resv_port(*sock, (u_short *) 0) < 0)
+  if (bind_resv_port(*sock, (u_short *) NULL) < 0)
     plog(XLOG_ERROR, "couldn't bind mountd socket to privileged port");
 
   if ((client = clnt_vc_create(*sock, &nb, MOUNTPROG, mnt_version, 0, 0))
@@ -250,7 +250,7 @@ tryudp:
     plog(XLOG_ERROR, "t_open %s: %m", nc->nc_device);
     goto badout;               /* neither tcp not udp succeeded */
   }
-  if (bind_resv_port(*sock, (u_short *) 0) < 0)
+  if (bind_resv_port(*sock, (u_short *) NULL) < 0)
     plog(XLOG_ERROR, "couldn't bind mountd socket to privileged port");
 
   if ((client = clnt_dg_create(*sock, &nb, MOUNTPROG, mnt_version, 0, 0))
@@ -347,7 +347,7 @@ bind_resv_port_only_udp(u_short *pp)
    * correct device name to udp, and t_open a descriptor to be used in
    * t_bind below.
    */
-  td = t_open(nc->nc_device, O_RDWR, (struct t_info *) 0);
+  td = t_open(nc->nc_device, O_RDWR, (struct t_info *) NULL);
   endnetconfig(nc_handle);
 
   if (td < 0) {
@@ -483,7 +483,7 @@ bind_preferred_amq_port(u_short pref_port,
     return -1;
   }
 
-  td = t_open(ncp->nc_device, O_RDWR, (struct t_info *) 0);
+  td = t_open(ncp->nc_device, O_RDWR, (struct t_info *) NULL);
   if (td < 0) {
     plog(XLOG_ERROR, "t_open failed: %d: %s", t_errno, t_errlist[t_errno]);
     return -1;
@@ -840,7 +840,7 @@ out:
 int
 register_autofs_service(char *autofs_conftype, void (*autofs_dispatch)())
 {
-  struct t_bind *tbp = 0;
+  struct t_bind *tbp = NULL;
   struct netconfig *autofs_ncp;
   SVCXPRT *autofs_xprt = NULL;
   int fd = -1, err = 1;                /* assume failed */
index 435aa763539ef787201585ebce2d64531b292874..cf1774ca67eff7c88ef324830340b2a133b12d75 100644 (file)
@@ -55,7 +55,7 @@
 int
 umount_fs(char *mntdir, const char *mnttabname, u_int unmount_flags)
 {
-  mntlist *mlist, *mp, *mp_save = 0;
+  mntlist *mlist, *mp, *mp_save = NULL;
   int error = 0;
 
   mp = mlist = read_mtab(mntdir, mnttabname);
@@ -140,7 +140,7 @@ umount_fs(char *mntdir, const char *mnttabname, u_int unmount_flags)
        * Search the mount table looking for
        * the correct (ie last) matching entry
        */
-      mp_save = 0;
+      mp_save = NULL;
       while (mp) {
        if (STREQ(mp->mnt->mnt_dir, mntdir))
          mp_save = mp;
@@ -149,7 +149,7 @@ umount_fs(char *mntdir, const char *mnttabname, u_int unmount_flags)
 
       if (mp_save) {
        mnt_free(mp_save->mnt);
-       mp_save->mnt = 0;
+       mp_save->mnt = NULL;
        rewrite_mtab(mlist, mnttabname);
       }
 #endif /* MOUNT_TABLE_ON_FILE */
@@ -178,7 +178,7 @@ umount2_fs(const char *mntdir, u_int unmount_flags)
   int error = 0;
 #if 0
     u_int vfs_id = 0;
-#endif
+#endif /* 0 */
 
   if (unmount_flags & AMU_UMOUNT_FORCE) {
     plog(XLOG_INFO, "**UNIMPLEMENTED**: umount2_fs: trying unmount/forced on %s", mntdir);
@@ -194,7 +194,7 @@ umount2_fs(const char *mntdir, u_int unmount_flags)
       plog(XLOG_WARNING, "%u: unmount/force: %m", vfs_id);
     else
       dlog("%s: unmount/force: OK", mntdir);
-#endif
+#endif /* 0 */
   }
   return error;
 }
index c86367c44d50337d583605d22a46592e72941c01..c5d51bb690c332f2746f54d89591ac5daeb0df25 100644 (file)
@@ -105,6 +105,7 @@ int
 umount2_fs(const char *mntdir, u_int unmount_flags)
 {
   int error = 0;
+
   if (unmount_flags & AMU_UMOUNT_FORCE) {
     plog(XLOG_INFO, "umount2_fs: trying unmount/forced on %s", mntdir);
     error = unmount(mntdir, MNT2_GEN_OPT_FORCE);
index e5fa7ad3926deb44f58f943d13104d8268eeb200..911810232a24f008810c34656bf5dbcf1fa0e8bd 100644 (file)
@@ -55,7 +55,7 @@
 int
 umount_fs(char *mntdir, const char *mnttabname, u_int unmount_flags)
 {
-  mntlist *mlist, *mp, *mp_save = 0;
+  mntlist *mlist, *mp, *mp_save = NULL;
   int error = 0;
 
   mp = mlist = read_mtab(mntdir, mnttabname);
@@ -140,7 +140,7 @@ umount_fs(char *mntdir, const char *mnttabname, u_int unmount_flags)
        * Search the mount table looking for
        * the correct (ie last) matching entry
        */
-      mp_save = 0;
+      mp_save = NULL;
       while (mp) {
        if (STREQ(mp->mnt->mnt_dir, mntdir))
          mp_save = mp;
@@ -149,7 +149,7 @@ umount_fs(char *mntdir, const char *mnttabname, u_int unmount_flags)
 
       if (mp_save) {
        mnt_free(mp_save->mnt);
-       mp_save->mnt = 0;
+       mp_save->mnt = NULL;
        rewrite_mtab(mlist, mnttabname);
       }
 #endif /* MOUNT_TABLE_ON_FILE */
@@ -176,6 +176,7 @@ int
 umount2_fs(const char *mntdir, u_int unmount_flags)
 {
   int error = 0;
+
   if (unmount_flags & AMU_UMOUNT_FORCE) {
     plog(XLOG_INFO, "umount2_fs: trying unmount/forced on %s", mntdir);
     error = umount2(mntdir, MNT2_GEN_OPT_FORCE); /* Solaris */
index e9965b65313b8816b4de1b84acb57fa569682294..0393575e781a85cab5f8ad9a70bdf7af02648e75 100644 (file)
 int
 umount_fs(char *mntdir, const char *mnttabname, u_int unmount_flags)
 {
-  mntlist *mlist, *mp, *mp_save = 0;
+  mntlist *mlist, *mp, *mp_save = NULL;
   int error = 0;
 #ifdef HAVE_LOOP_DEVICE
-  char *opt, *xopts=NULL;
+  char *opt, *xopts = NULL;
   char loopstr[] = "loop=";
   char *loopdev;
 #endif /* HAVE_LOOP_DEVICE */
@@ -190,7 +190,7 @@ umount_fs(char *mntdir, const char *mnttabname, u_int unmount_flags)
    * Search the mount table looking for
    * the correct (ie last) matching entry
    */
-  mp_save = 0;
+  mp_save = NULL;
   while (mp) {
     if (STREQ(mp->mnt->mnt_dir, mntdir))
       mp_save = mp;
@@ -199,7 +199,7 @@ umount_fs(char *mntdir, const char *mnttabname, u_int unmount_flags)
 
   if (mp_save) {
     mnt_free(mp_save->mnt);
-    mp_save->mnt = 0;
+    mp_save->mnt = NULL;
     rewrite_mtab(mlist, mnttabname);
   }
 #endif /* MOUNT_TABLE_ON_FILE */
index 182ec10ccaaea6ae6f185aef93a408090380236c..a81d2934b33e1526daecd994e62f502b590a4be0 100644 (file)
@@ -108,6 +108,7 @@ int
 umount2_fs(const char *mntdir, u_int unmount_flags)
 {
   int error = 0;
+
   if (unmount_flags & AMU_UMOUNT_FORCE) {
     plog(XLOG_INFO, "umount2_fs: trying unmount/forced on %s", mntdir);
     error = umount((char *)mntdir, MNT2_GEN_OPT_FORCE);
index ce1c59c2a4607c85395eb74277d50f71c4e25d49..47ee11b9049d4b538527e2ff8ced528414980ac7 100644 (file)
@@ -180,7 +180,7 @@ remove_mount(CLIENT *client, char *host, mountlist ml, int fixit)
                           (XDRPROC_T_TYPE) xdr_dirpath,
                           (char *) &pathp,
                           (XDRPROC_T_TYPE) xdr_void,
-                          (char *) 0,
+                          (char *) NULL,
                           tv)) != RPC_SUCCESS) {
       fprintf(stderr, "%s:%s MOUNTPROC_UMNT: ",
              host, ml->ml_directory);
@@ -239,9 +239,9 @@ remove_all(CLIENT *client, char *host)
   if ((estat = clnt_call(client,
                         MOUNTPROC_UMNTALL,
                         (XDRPROC_T_TYPE) xdr_void,
-                        (char *) 0,
+                        (char *) NULL,
                         (XDRPROC_T_TYPE) xdr_void,
-                        (char *) 0,
+                        (char *) NULL,
                         tv)) != RPC_SUCCESS) {
     /*
      * RPC_SYSTEMERROR is returned even if all went well
@@ -393,7 +393,7 @@ main(int argc, char *argv[])
       if ((estat = clnt_call(client,
                             MOUNTPROC_DUMP,
                             (XDRPROC_T_TYPE) xdr_void,
-                            (char *) 0,
+                            (char *) NULL,
                             (XDRPROC_T_TYPE) xdr_mountlist,
                             (char *) &mntdump,
                             tv)) != RPC_SUCCESS) {
@@ -407,7 +407,7 @@ main(int argc, char *argv[])
       if ((estat = clnt_call(client,
                             MOUNTPROC_EXPORT,
                             (XDRPROC_T_TYPE) xdr_void,
-                            (char *) 0,
+                            (char *) NULL,
                             (XDRPROC_T_TYPE) xdr_exports,
                             (char *) &mntexports,
                             tv)) != RPC_SUCCESS) {
index f01c63e4048d20e9a0bb1ade2a8066d05739a4e6..7c99d9958a3db071cf3b8baabdfb8f4512d026b4 100644 (file)
 
 char *disk_fs_strings[] =
 {
-  "fstype", "opts", "dumpset", "passno", "freq", "mount", "log", 0,
+  "fstype", "opts", "dumpset", "passno", "freq", "mount", "log", NULL,
 };
 
 char *mount_strings[] =
 {
-  "volname", "exportfs", 0,
+  "volname", "exportfs", NULL,
 };
 
 char *fsmount_strings[] =
 {
-  "as", "volname", "fstype", "opts", "from", 0,
+  "as", "volname", "fstype", "opts", "from", NULL,
 };
 
 char *host_strings[] =
 {
-  "host", "netif", "config", "arch", "cluster", "os", 0,
+  "host", "netif", "config", "arch", "cluster", "os", NULL,
 };
 
 char *ether_if_strings[] =
 {
-  "inaddr", "netmask", "hwaddr", 0,
+  "inaddr", "netmask", "hwaddr", NULL,
 };
 
 
@@ -121,7 +121,7 @@ compute_hostpath(char *hn)
   do {
     d = strrchr(p, '.');
     if (d) {
-      *d = 0;
+      *d = '\0';
       strcat(path, d + 1);
       strcat(path, "/");
     } else {
@@ -250,7 +250,7 @@ static int
 analyze_dkmounts(disk_fs *dk, qelem *q)
 {
   int errors = 0;
-  fsi_mount *mp, *mp2 = 0;
+  fsi_mount *mp, *mp2 = NULL;
   int i = 0;
 
   /*
@@ -304,12 +304,12 @@ analyze_dkmounts(disk_fs *dk, qelem *q)
   /*
    * Analyze the mount tree
    */
-  errors += analyze_dkmount_tree(q, 0, dk);
+  errors += analyze_dkmount_tree(q, NULL, dk);
 
   /*
    * Analyze the export tree
    */
-  errors += check_exportfs(q, 0);
+  errors += check_exportfs(q, NULL);
 
   return errors;
 }
@@ -414,7 +414,7 @@ fixup_required_mount_info(fsmount *fp, dict_ent *de)
       lerror(fp->f_ioloc, "ambiguous mount: %s is a replicated filesystem", fp->f_volname);
     } else {
       dict_data *dd;
-      fsi_mount *mp = 0;
+      fsi_mount *mp = NULL;
       dd = AM_FIRST(dict_data, &de->de_q);
       mp = (fsi_mount *) dd->dd_data;
       if (!mp)
@@ -495,7 +495,7 @@ analyze_mounts(host *hp)
       matched = 1;
     } else
       do {
-       p = 0;
+       p = NULL;
        de = find_volname(nn);
        fsi_log("Mount: %s (trying %s)", fp->f_volname, nn);
 
@@ -510,7 +510,7 @@ analyze_mounts(host *hp)
           */
          if (ISSET(fp->f_mask, FM_FROM) && !ISSET(fp->f_mask, FM_DIRECT)) {
            dict_data *dd;
-           fsi_mount *mp2 = 0;
+           fsi_mount *mp2 = NULL;
 
            ITER(dd, dict_data, &de->de_q) {
              fsi_mount *mp = (fsi_mount *) dd->dd_data;
@@ -533,7 +533,7 @@ analyze_mounts(host *hp)
        }
        p = strrchr(nn, '/');
        if (p)
-         *p = 0;
+         *p = '\0';
       } while (de && p);
     XFREE(nn);
 
index 08f8652ec70895c3c5d6fae3bb8d419276846960..cb5c774e656120a2b56e742aaf1d88ac08da5bc0 100644 (file)
@@ -233,7 +233,7 @@ filesystem :
          { $4->d_dev = $2; $$ = $4; }
 
        | tFS error '}'
-         { $$ = (disk_fs *) 0; }
+         { $$ = (disk_fs *) NULL; }
        ;
 
 /*
index 7e462b1deff2473262c678bfc2e74b0539c2b56e..8ada478919776a1da3ad579ec0139fc3f7594de4 100644 (file)
@@ -153,7 +153,7 @@ struct r {
   { "passno", tPASSNO },
   { "sel", tSEL },
   { "volname", tVOLNAME },
-  { 0, 0 },
+  { NULL, 0 },
 };
 #define        NRES_WORDS (sizeof(rr)/sizeof(rr[0])-1)
 
index 82de18c8adcd2edd2ba12c840a7d9d82fb02d5a2..7d2d2b60d6cc1c43c253d4eacd65cfddd68edfdf 100644 (file)
@@ -201,7 +201,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 +235,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 +316,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;
 }
index 2275d94d9271351b1652c5a8e66a1bce1baa3ffd..eac4c7200e4ab05735ca41d39709988ff2c4792c 100644 (file)
@@ -89,7 +89,7 @@ static struct os_fstab_type {
     "u4_0", write_ultrix_dkfstab, write_ultrix_dkrmount
   },                           /* Ultrix */
   {
-    0, 0, 0
+    NULL, NULL, NULL
   }
 };
 
@@ -261,8 +261,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) {
index c81d64f233265bba968ffb4c1ed4ce36a05f9808..cff4e5423d96ebcf91de5f4c7053afdccdde460f 100644 (file)
@@ -82,7 +82,7 @@ char *alt_spooldir = ALT_SPOOLDIR;
 char *home_subdir = HOME_SUBDIR;
 char *logfile = DEFAULT_LOGFILE;
 char *passwdfile = NULL;       /* alternate passwd file to use */
-char *slinkname = 0;
+char *slinkname = NULL;
 char hostname[MAXHOSTNAMELEN + 1] = "localhost";
 u_int cache_interval = DEFAULT_CACHE_INTERVAL;
 gid_t hlfs_gid = (gid_t) INVALIDID;
@@ -737,10 +737,10 @@ hlfsd_init(void)
 # endif /* not defined(DEBUG) || defined(DEBUG_PRINT) */
 #endif /* not HAVE_SIGACTION */
 
-  if (setitimer(ITIMER_REAL, &reloadinterval, (struct itimerval *) 0) < 0)
+  if (setitimer(ITIMER_REAL, &reloadinterval, (struct itimerval *) NULL) < 0)
     fatal("setitimer: %m");
 
-  gettimeofday((struct timeval *) ((void *)&startup), (struct timezone *) 0);
+  gettimeofday((struct timeval *) ((void *)&startup), (struct timezone *) NULL);
 
   /*
    * If not -D daemon, then start serving here in the child,
index 18374a72bfd7dbc8ef44d8205b9afd4b495b9fae..9a33e63ff946781c3f224ef1af340c387b6535b2 100644 (file)
@@ -276,7 +276,7 @@ delay(uid2home_t *found, int secs)
 
   do {
     tv.tv_sec = secs;
-    if (select(0, 0, 0, 0, &tv) == 0)
+    if (select(0, NULL, NULL, NULL, &tv) == 0)
       break;
   } while (--secs && found->child);
 }
@@ -297,7 +297,7 @@ interlock(int signum)
 #ifdef HAVE_WAITPID
   while ((child = waitpid((pid_t) -1, &status, WNOHANG)) > 0) {
 #else /* not HAVE_WAITPID */
-  while ((child = wait3(&status, WNOHANG, (struct rusage *) 0)) > 0) {
+  while ((child = wait3(&status, WNOHANG, (struct rusage *) NULL)) > 0) {
 #endif /* not HAVE_WAITPID */
 
     /* high chances this was the last child forked */
index d2cf05fa5e13f47ce34bbd14787503db119d3181..0f1894f72c8b5534a677a4dc43bf79c78ad73b90 100644 (file)
@@ -137,7 +137,7 @@ nfsproc_getattr_2_svc(am_nfs_fh *argp, struct svc_req *rqstp)
       rootfattr.na_mtime.nt_seconds++;
       rootfattr.na_uid = uid;
     }
-#endif
+#endif /* 0 */
     res.ns_status = NFS_OK;
     res.ns_u.ns_attr_u = rootfattr;
   } else if (eq_fh(argp, &slink)) {
@@ -241,7 +241,7 @@ nfsproc_lookup_2_svc(nfsdiropargs *argp, struct svc_req *rqstp)
        rootfattr.na_mtime.nt_seconds++;
        rootfattr.na_uid = uid;
       }
-#endif
+#endif /* 0 */
       res.dr_u.dr_drok_u.drok_fhandle = root;
       res.dr_u.dr_drok_u.drok_attributes = rootfattr;
       res.dr_status = NFS_OK;
@@ -317,7 +317,7 @@ nfsproc_readlink_2_svc(am_nfs_fh *argp, struct svc_req *rqstp)
     if (getcreds(rqstp, &userid, &groupid, nfsxprt) < 0)
       return (nfsreadlinkres *) NULL;
 
-    gettimeofday((struct timeval *) &slinkfattr.na_atime, (struct timezone *) 0);
+    gettimeofday((struct timeval *) &slinkfattr.na_atime, (struct timezone *) NULL);
 
     res.rlr_status = NFS_OK;
     if (groupid == hlfs_gid) {
@@ -480,7 +480,7 @@ nfsreaddirres *
 nfsproc_readdir_2_svc(nfsreaddirargs *argp, struct svc_req *rqstp)
 {
   static nfsreaddirres res;
-  static nfsentry slinkent = {SLINKID, 0, {SLINKCOOKIE}};
+  static nfsentry slinkent = {SLINKID, NULL, {SLINKCOOKIE}};
   static nfsentry dotdotent = {ROOTID, "..", {DOTDOTCOOKIE}, &slinkent};
   static nfsentry dotent = {ROOTID, ".", {DOTCOOKIE}, &dotdotent};
 
@@ -489,7 +489,7 @@ nfsproc_readdir_2_svc(nfsreaddirargs *argp, struct svc_req *rqstp)
   if (eq_fh(&argp->rda_fhandle, &slink)) {
     res.rdr_status = NFSERR_NOTDIR;
   } else if (eq_fh(&argp->rda_fhandle, &root)) {
-    gettimeofday((struct timeval *) &rootfattr.na_atime, (struct timezone *) 0);
+    gettimeofday((struct timeval *) &rootfattr.na_atime, (struct timezone *) NULL);
 
     res.rdr_status = NFS_OK;
     switch (argp->rda_cookie[0]) {
@@ -503,7 +503,7 @@ nfsproc_readdir_2_svc(nfsreaddirargs *argp, struct svc_req *rqstp)
       res.rdr_u.rdr_reply_u.dl_entries = &slinkent;
       break;
     case SLINKCOOKIE:
-      res.rdr_u.rdr_reply_u.dl_entries = (nfsentry *) 0;
+      res.rdr_u.rdr_reply_u.dl_entries = (nfsentry *) NULL;
       break;
     }
     res.rdr_u.rdr_reply_u.dl_eof = TRUE;
index 8c27ce8095189af8de17aeea0ea4cbdb2ab6b2ff..ee52c77af9a16335a7eb8ca99f2e6334a8133b4a 100644 (file)
@@ -141,16 +141,16 @@ struct am_LOOKUP3resok {
 #if 0
        post_op_attr obj_attributes;
        post_op_attr dir_attributes;
-#endif
+#endif /* 0 */
 };
 typedef struct am_LOOKUP3resok am_LOOKUP3resok;
 
 struct am_LOOKUP3resfail {
 #if 0
        post_op_attr dir_attributes;
-#else
+#else /* !0 */
        char dummy;             /* cannot have an empty declaration */
-#endif
+#endif /* !0 */
 };
 typedef struct am_LOOKUP3resfail am_LOOKUP3resfail;
 
index 163b17095eae761d284572a66ccdfe0fa698c65e..866076cb87888f69f451bcc6bf2fc77a6d2d521b 100644 (file)
@@ -164,10 +164,10 @@ mount_fs(mntent_t *mnt, int flags, caddr_t mnt_data, int retry, MTYPE_TYPE type,
 #ifdef MOUNT_TABLE_ON_FILE
   char *zopts = NULL, *xopts = NULL;
 #endif /* MOUNT_TABLE_ON_FILE */
-  char *mnt_dir = 0;
+  char *mnt_dir = NULL;
 
 #ifdef NEED_AUTOFS_SPACE_HACK
-  char *old_mnt_dir = 0;
+  char *old_mnt_dir = NULL;
   /* perform space hack */
   if (on_autofs) {
     old_mnt_dir = mnt->mnt_dir;
index 4ee6b6e77bba3cd3f606284a266aa148d93d5d94..9ac497997154c12ac6ed22fa8aac65116453017f 100644 (file)
@@ -58,7 +58,7 @@ strdup(const char *s)
   char *sp = (char *) xmalloc(len + 1);
 
   memmove(sp, s, len);
-  sp[len] = 0;
+  sp[len] = '\0';
 
   return sp;
 }
index 63966ec300af5f44dbc1040141dcbe0a87c9e07f..d11d318e114fed09c8a085ff7d1842cb03cfbe0b 100644 (file)
@@ -57,7 +57,7 @@ strnsave(const char *str, int len)
 {
   char *sp = (char *) xmalloc(len + 1);
   memmove(sp, str, len);
-  sp[len] = 0;
+  sp[len] = '\0';
 
   return sp;
 }
index c842f510a4685e3bac78d617a902a430a828ddf3..d38fb9be206ac17b1247f5b9f8d2bc605570c5f8 100644 (file)
@@ -1042,7 +1042,7 @@ xdr_am_LOOKUP3resfail(XDR *xdrs, am_LOOKUP3resfail *objp)
 #if 0
   if (!xdr_post_op_attr(xdrs, &objp->dir_attributes))
     return (FALSE);
-#endif
+#endif /* 0 */
   return (TRUE);
 }
 
@@ -1064,7 +1064,7 @@ xdr_am_LOOKUP3resok(XDR *xdrs, am_LOOKUP3resok *objp)
     return (FALSE);
   if (!xdr_post_op_attr(xdrs, &objp->dir_attributes))
     return (FALSE);
-#endif
+#endif /* 0 */
   return (TRUE);
 }
 
index 4b6b214eb620aa2894039006d3db043da8ca7756..7d6966e2f6e628391738f60af8843f6e0813c76b 100644 (file)
@@ -107,7 +107,7 @@ struct opt_tab dbg_opt[] =
   {"test", D_TEST},            /* Full debug - no daemon, no amq, local mtab */
   {"trace", D_TRACE},          /* Protocol trace */
   {"xdrtrace", D_XDRTRACE},    /* Trace xdr routines */
-  {0, 0}
+  {NULL, 0}
 };
 #endif /* DEBUG */
 
@@ -128,7 +128,7 @@ struct opt_tab xlog_opt[] =
   {"user", XLOG_USER},         /* Non-fatal user errors */
   {"warn", XLOG_WARNING},      /* Warnings */
   {"warning", XLOG_WARNING},   /* Warnings */
-  {0, 0}
+  {NULL, 0}
 };
 
 
@@ -316,7 +316,7 @@ static void
 show_time_host_and_name(int lvl)
 {
   static time_t last_t = 0;
-  static char *last_ctime = 0;
+  static char *last_ctime = NULL;
   time_t t;
 #if defined(HAVE_CLOCK_GETTIME) && defined(DEBUG)
   struct timespec ts;
@@ -576,7 +576,7 @@ cmdoption(char *s, struct opt_tab *optb, int *flags)
   while (p && *p) {
     int neg;
     char *opt;
-    struct opt_tab *dp, *dpn = 0;
+    struct opt_tab *dp, *dpn = NULL;
 
     s = p;
     p = strchr(p, ',');
index f90be4a7739bde3dfebe590689d1d1e44cebd833..0158f5967f987ed5a785d1459c21d2be7797ff60 100644 (file)
@@ -59,7 +59,7 @@ main(int argc, char **argv)
   char *testhost, *proto, *tmp_buf;
   int nv, ret;
   struct sockaddr_in *ip;
-  struct hostent *hp = 0;
+  struct hostent *hp = NULL;
 
   am_set_progname(argv[0]);