* fsinfo/*.[hc]: rename fsinfo function log() to fsi_log(), to
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 18 Jul 2003 04:50:16 +0000 (04:50 +0000)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 18 Jul 2003 04:50:16 +0000 (04:50 +0000)
avoid conflict with builtin function in gcc-3.3.

* amd/amfs_auto.c (amfs_auto_mount): When pref:=NULL set am_pref
to strdup("") instead of NULL since this value will be
freed. Contributed by Matt Chapman <matthewc@cse.unsw.edu.au>.

AUTHORS
ChangeLog
NEWS
amd/amfs_auto.c
fsinfo/fsi_analyze.c
fsinfo/fsi_util.c
fsinfo/fsinfo.c
fsinfo/fsinfo.h
fsinfo/wr_fstab.c

diff --git a/AUTHORS b/AUTHORS
index d27b0c2a6ea6f7ae0c348814f567a1751b3f231b..148b2a008d7dcbf62d4df506d74efce51c79673f 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -327,6 +327,8 @@ disabling LDAP/Hesiod, fixes for the dev/nodev option on Linux
 November 28, 2001: Bug fix.  Support "nolock" as an NFS option, not a
 generic mount option.
 
+July 17, 2003: Debian fixes.  Null am_pref free.
+
 * Trond Myklebust <trond.myklebust@fys.uio.no>
 January 10, 2002: Proper initialization of the timeo parameter on Linux, TCP
 _must_ have a timeout 2 orders of magnitude larger than UDP
index e970aa670d3a805d3c051e4c25b3fbebe3edc660..d5454233e5a84de7216485063efa67587b070a9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2003-07-17  Erez Zadok  <ezk@filer.fsl.cs.sunysb.edu>
+
+       * fsinfo/*.[hc]: rename fsinfo function log() to fsi_log(), to
+       avoid conflict with builtin function in gcc-3.3.
+
+2003-07-17  Philippe Troin  <phil@fifi.org>
+
+       * amd/amfs_auto.c (amfs_auto_mount): When pref:=NULL set am_pref
+       to strdup("") instead of NULL since this value will be
+       freed. Contributed by Matt Chapman <matthewc@cse.unsw.edu.au>.
+
 2003-06-09  Erez Zadok  <ezk@agora.fsl.cs.sunysb.edu>
 
        * mk-amd-map/mk-amd-map.c (main): open temp db file using O_EXCL,
diff --git a/NEWS b/NEWS
index edee0f214978ad5f7ecdaf557f3dfb1d49a41484..7439f786500a29f4f1bb260f73c5de415f026d13 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,10 @@
        i386-unknown-freebsd5.0 (5.0-RELEASE)
        sparc64-unknown-linux-suse7.3
 
+- bug fixes:
+       rename log() in fsinfo to avoid glibc/gcc-3.3 conflict
+       am_pref free NULL pointer
+
 *** Notes specific to am-utils version 6.0.9:
 
 - Minor new ports:
index ed6c8e881eff4dbbc50addd27525aef4a0169fc6..995b83745ec665aaeae3b50c9884bbc0811d330b 100644 (file)
@@ -38,7 +38,7 @@
  *
  *      %W% (Berkeley) %G%
  *
- * $Id: amfs_auto.c,v 1.9.2.10 2002/12/27 22:44:29 ezk Exp $
+ * $Id: amfs_auto.c,v 1.9.2.11 2003/07/18 04:50:18 ezk Exp $
  *
  */
 
@@ -188,7 +188,7 @@ amfs_auto_mount(am_node *mp)
   if (mf->mf_fo->opt_pref) {
     /* allow pref:=null to set a real null prefix */
     if (STREQ(mf->mf_fo->opt_pref, "null")) {
-      mp->am_pref = "";
+      mp->am_pref = strdup("");
     } else {
       /*
        * the prefix specified as an option
index 0f2bffa1849f2ad6dfee4f13d57fef747fe2ec82..4bede12950614b00489876fe132cd18783b7f833 100644 (file)
@@ -38,7 +38,7 @@
  *
  *      %W% (Berkeley) %G%
  *
- * $Id: fsi_analyze.c,v 1.3.2.3 2002/12/27 22:45:04 ezk Exp $
+ * $Id: fsi_analyze.c,v 1.3.2.4 2003/07/18 04:50:19 ezk Exp $
  *
  */
 
@@ -130,7 +130,7 @@ compute_hostpath(char *hn)
     }
   } while (d);
 
-  log("hostpath of '%s' is '%s'", hn, path);
+  fsi_log("hostpath of '%s' is '%s'", hn, path);
 
   strcpy(p, path);
   return p;
@@ -145,7 +145,7 @@ find_volname(char *nn)
   char *q;
 
   do {
-    log("Searching for volname %s", p);
+    fsi_log("Searching for volname %s", p);
     de = dict_locate(dict_of_volnames, p);
     q = strrchr(p, '/');
     if (q)
@@ -161,7 +161,7 @@ static void
 show_required(ioloc *l, int mask, char *info, char *hostname, char *strings[])
 {
   int i;
-  log("mask left for %s:%s is %#x", hostname, info, mask);
+  fsi_log("mask left for %s:%s is %#x", hostname, info, mask);
 
   for (i = 0; strings[i]; i++)
     if (ISSET(mask, i))
@@ -218,7 +218,7 @@ analyze_dkmount_tree(qelem *q, fsi_mount *parent, disk_fs *dk)
   int errors = 0;
 
   ITER(mp, fsi_mount, q) {
-    log("Mount %s:", mp->m_name);
+    fsi_log("Mount %s:", mp->m_name);
     if (parent) {
       char n[MAXPATHLEN];
       sprintf(n, "%s/%s", parent->m_name, mp->m_name);
@@ -226,7 +226,7 @@ analyze_dkmount_tree(qelem *q, fsi_mount *parent, disk_fs *dk)
        lerror(mp->m_ioloc, "sub-directory %s of %s starts with '/'", mp->m_name, parent->m_name);
       else if (STREQ(mp->m_name, "default"))
        lwarning(mp->m_ioloc, "sub-directory of %s is named \"default\"", parent->m_name);
-      log("Changing name %s to %s", mp->m_name, n);
+      fsi_log("Changing name %s to %s", mp->m_name, n);
       XFREE(mp->m_name);
       mp->m_name = strdup(n);
     }
@@ -287,7 +287,7 @@ analyze_dkmounts(disk_fs *dk, qelem *q)
       compute_automount_point(nbuf, dk->d_host, mp2->m_volname);
       XFREE(mp2->m_name);
       mp2->m_name = strdup(nbuf);
-      log("%s:%s has default mount on %s", dk->d_host->h_hostname, dk->d_dev, mp2->m_name);
+      fsi_log("%s:%s has default mount on %s", dk->d_host->h_hostname, dk->d_dev, mp2->m_name);
     } else {
       lerror(dk->d_ioloc, "no volname given for %s:%s", dk->d_host->h_hostname, dk->d_dev);
       errors++;
@@ -422,24 +422,24 @@ fixup_required_mount_info(fsmount *fp, dict_ent *de)
        abort();
       fp->f_ref = mp;
       set_fsmount(fp, FM_FROM, mp->m_dk->d_host->h_hostname);
-      log("set: %s comes from %s", fp->f_volname, fp->f_from);
+      fsi_log("set: %s comes from %s", fp->f_volname, fp->f_from);
     }
   }
 
   if (!ISSET(fp->f_mask, FM_FSTYPE)) {
     set_fsmount(fp, FM_FSTYPE, strdup("nfs"));
-    log("set: fstype is %s", fp->f_fstype);
+    fsi_log("set: fstype is %s", fp->f_fstype);
   }
 
   if (!ISSET(fp->f_mask, FM_OPTS)) {
     set_fsmount(fp, FM_OPTS, strdup("rw,nosuid,grpid,defaults"));
-    log("set: opts are %s", fp->f_opts);
+    fsi_log("set: opts are %s", fp->f_opts);
   }
 
   if (!ISSET(fp->f_mask, FM_LOCALNAME)) {
     if (fp->f_ref) {
       set_fsmount(fp, FM_LOCALNAME, strdup(fp->f_volname));
-      log("set: localname is %s", fp->f_localname);
+      fsi_log("set: localname is %s", fp->f_localname);
     } else {
       lerror(fp->f_ioloc, "cannot determine localname since volname %s is not uniquely defined", fp->f_volname);
     }
@@ -461,7 +461,7 @@ analyze_drives(host *hp)
 
   ITER(dp, disk_fs, q) {
     int req;
-    log("Disk %s:", dp->d_dev);
+    fsi_log("Disk %s:", dp->d_dev);
     dp->d_host = hp;
     fixup_required_disk_info(dp);
     req = ~dp->d_mask & DF_REQUIRED;
@@ -498,7 +498,7 @@ analyze_mounts(host *hp)
       do {
        p = 0;
        de = find_volname(nn);
-       log("Mount: %s (trying %s)", fp->f_volname, nn);
+       fsi_log("Mount: %s (trying %s)", fp->f_volname, nn);
 
        if (de) {
          found = 1;
@@ -577,7 +577,7 @@ analyze_hosts(qelem *q)
    * Check all drives
    */
   ITER(hp, host, q) {
-    log("disks on host %s", hp->h_hostname);
+    fsi_log("disks on host %s", hp->h_hostname);
     show_new("ana-host");
     hp->h_hostpath = compute_hostpath(hp->h_hostname);
 
@@ -592,7 +592,7 @@ analyze_hosts(qelem *q)
    * Check static mounts
    */
   ITER(hp, host, q) {
-    log("mounts on host %s", hp->h_hostname);
+    fsi_log("mounts on host %s", hp->h_hostname);
     show_new("ana-mount");
     if (hp->h_mount)
       analyze_mounts(hp);
@@ -634,21 +634,21 @@ analyze_automount_tree(qelem *q, char *pref, int lvl)
     sprintf(nname, "%s/%s", pref, ap->a_name);
     XFREE(ap->a_name);
     ap->a_name = strdup(nname[1] == '/' ? nname + 1 : nname);
-    log("automount point %s:", ap->a_name);
+    fsi_log("automount point %s:", ap->a_name);
     show_new("ana-automount");
 
     if (ap->a_mount) {
       analyze_automount_tree(ap->a_mount, ap->a_name, lvl + 1);
     } else if (ap->a_hardwiredfs) {
-      log("\thardwired from %s to %s", ap->a_volname, ap->a_hardwiredfs);
+      fsi_log("\thardwired from %s to %s", ap->a_volname, ap->a_hardwiredfs);
     } else if (ap->a_volname) {
-      log("\tautomount from %s", ap->a_volname);
+      fsi_log("\tautomount from %s", ap->a_volname);
       analyze_automount(ap);
     } else if (ap->a_symlink) {
-      log("\tsymlink to %s", ap->a_symlink);
+      fsi_log("\tsymlink to %s", ap->a_symlink);
     } else {
       ap->a_volname = strdup(ap->a_name);
-      log("\timplicit automount from %s", ap->a_volname);
+      fsi_log("\timplicit automount from %s", ap->a_volname);
       analyze_automount(ap);
     }
   }
index 8874188dec9c7071239095a83cb1f2ad43603ba1..a41b3be38613b57cc0421f1d0c13d381f21f1aa8 100644 (file)
@@ -35,7 +35,7 @@
  *
  *      %W% (Berkeley) %G%
  *
- * $Id: fsi_util.c,v 1.3.2.4 2002/12/27 22:45:06 ezk Exp $
+ * $Id: fsi_util.c,v 1.3.2.5 2003/07/18 04:50:19 ezk Exp $
  *
  */
 
@@ -170,7 +170,7 @@ fatal(char *fmt, ...)
  * Debug log
  */
 void
-log(char *fmt, ...)
+fsi_log(char *fmt, ...)
 {
   va_list ap;
 
@@ -277,7 +277,7 @@ pref_open(char *pref, char *hn, void (*hdr) (FILE *, char *), char *arg)
   FILE *ef;
 
   sprintf(p, "%s%s", pref, hn);
-  log("Writing %s info for %s to %s", pref, hn, p);
+  fsi_log("Writing %s info for %s to %s", pref, hn, p);
   ef = fopen(p, "w");
   if (ef) {
     (*hdr) (ef, arg);
index e747568429a81440acaf3b13e0d2aeab44ce2ffb..6db19100b99b6ee83dd833dfca0b5517a5628058 100644 (file)
@@ -38,7 +38,7 @@
  *
  *      %W% (Berkeley) %G%
  *
- * $Id: fsinfo.c,v 1.5.2.4 2002/12/27 22:45:06 ezk Exp $
+ * $Id: fsinfo.c,v 1.5.2.5 2003/07/18 04:50:20 ezk Exp $
  *
  */
 
@@ -184,9 +184,9 @@ Usage: %s [-v] [-a autodir] [-h hostname] [-b bootparams] [-d dumpsets]\n\
   }
 
   if (g_argv[0])
-    log("g_argv[0] = %s", g_argv[0]);
+    fsi_log("g_argv[0] = %s", g_argv[0]);
   else
-    log("g_argv[0] = (nil)");
+    fsi_log("g_argv[0] = (nil)");
 }
 
 
index 2b0d77e47a28f377e8a8cd61727be96e2b2cc683..7744d8d24a5554ea00efecc70380b2d097f81489 100644 (file)
@@ -38,7 +38,7 @@
  *
  *      %W% (Berkeley) %G%
  *
- * $Id: fsinfo.h,v 1.4.2.4 2002/12/27 22:45:07 ezk Exp $
+ * $Id: fsinfo.h,v 1.4.2.5 2003/07/18 04:50:20 ezk Exp $
  *
  */
 
@@ -93,7 +93,7 @@ extern void init_que(qelem *);
 extern void ins_que(qelem *, qelem *);
 extern void lerror(ioloc *l, char *fmt, ...)
        __attribute__((__format__(__printf__, 2, 3)));
-extern void log(char *fmt, ...)
+extern void fsi_log(char *fmt, ...)
        __attribute__((__format__(__printf__, 1, 2)));
 extern void lwarning(ioloc *l, char *fmt, ...)
        __attribute__((__format__(__printf__, 2, 3)));
index b31b47684e1dbd198174539e70aa30bfe56374b9..0243890b879fc1c8ac0829cac1677a63428c76c8 100644 (file)
@@ -38,7 +38,7 @@
  *
  *      %W% (Berkeley) %G%
  *
- * $Id: wr_fstab.c,v 1.3.2.3 2002/12/27 22:45:07 ezk Exp $
+ * $Id: wr_fstab.c,v 1.3.2.4 2003/07/18 04:50:20 ezk Exp $
  *
  */
 
@@ -326,7 +326,7 @@ write_fstab(qelem *q)
          if (hp->h_disk_fs)
            errors += write_dkfstab(ef, hp->h_disk_fs, op->op_fstab);
          else
-           log("No local disk mounts on %s", hp->h_hostname);
+           fsi_log("No local disk mounts on %s", hp->h_hostname);
 
          if (hp->h_mount)
            errors += write_dkrmount(ef, hp->h_mount, hp->h_hostname, op->op_mount);