* amd/get_args.c (get_args): move call to switch_to_logfile()
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 17 Feb 2005 03:37:42 +0000 (03:37 +0000)
committerErez Zadok <ezk@cs.sunysb.edu>
Thu, 17 Feb 2005 03:37:42 +0000 (03:37 +0000)
after processing -v, so we don't print "no logfile defined; using
stderr" when we're about to print version info and exit anyway.

* minor new port: powerpc-ibm-aix5.3.0.0.

* hlfsd/hlfsd.c (main): rewrite code to avoid negative array
references.

* conf/checkmount/checkmount_aix.c: remove extern definition for
mntctl(), since AIX 5.3 has it in <sys/vmount.h>.

* amd/info_union.c (union_reload): rewrite code to avoid negative
array references.

* amd/opts.c (split_opts, expand_op): rewrite code to avoid
negative array references.

* conf/mtab/mtab_aix.c: remove extern definition for mntctl(),
since AIX 5.3 has it in <sys/vmount.h>.

* libamu/xutil.c (real_plog): rewrite code to avoid negative array
references.

* libamu/wire.c (is_network_member): rearrange code slightly to
avoid negative array references (AIX 5.3 xlC 7.0 compiler
complains about it).

12 files changed:
.cvsignore
ChangeLog
NEWS
amd/get_args.c
amd/info_union.c
amd/opts.c
conf/checkmount/checkmount_aix.c
conf/mtab/mtab_aix.c
hlfsd/hlfsd.c
libamu/wire.c
libamu/xutil.c
m4/macros/os_cflags.m4

index 138bf6417098fd4bfd23e063a8eea472968dbe36..99988c785e067fc1c9a0d767ca23577057f07fec 100644 (file)
@@ -131,3 +131,5 @@ A.i386-unknown-netbsdelf1.6.2
 A.i386-unknown-netbsdelf2.0
 A.i386-unknown-openbsd3.6
 A.powerpc-apple-darwin7.6.0
+A.powerpc-ibm-aix5.3.0.0
+A.powerpc-ibm-aix5.3.0.0-cc
index 8950e10cb397121c62bb453659b2075431e75767..d83b18807c60061061fb99a62fc02d9240865643 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2005-02-16  Erez Zadok  <ezk@cs.sunysb.edu>
+
+       * amd/get_args.c (get_args): move call to switch_to_logfile()
+       after processing -v, so we don't print "no logfile defined; using
+       stderr" when we're about to print version info and exit anyway.
+
+       * minor new port: powerpc-ibm-aix5.3.0.0.
+
+       * hlfsd/hlfsd.c (main): rewrite code to avoid negative array
+       references.
+
+       * conf/checkmount/checkmount_aix.c: remove extern definition for
+       mntctl(), since AIX 5.3 has it in <sys/vmount.h>.
+
+       * amd/info_union.c (union_reload): rewrite code to avoid negative
+       array references.
+
+       * amd/opts.c (split_opts, expand_op): rewrite code to avoid
+       negative array references.
+
+       * conf/mtab/mtab_aix.c: remove extern definition for mntctl(),
+       since AIX 5.3 has it in <sys/vmount.h>.
+
+       * libamu/xutil.c (real_plog): rewrite code to avoid negative array
+       references.
+
+       * libamu/wire.c (is_network_member): rearrange code slightly to
+       avoid negative array references (AIX 5.3 xlC 7.0 compiler
+       complains about it).
+
 2005-01-26  Erez Zadok  <ezk@cs.sunysb.edu>
 
        * doc/am-utils.texi (xhost Selector Function): document new
diff --git a/NEWS b/NEWS
index edc227bf2c6d9b11fe7a93d07e0e7b5873cc99ab..4e8d2d9e503ecde9b5a5bc62d4496ad9619b0163 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,8 @@
        i386-unknown-netbsdelf2.0
        mipsel-unknown-linux-rhPS2 (Linux on Sony PlayStation 2)
        powerpc-apple-darwin7.6.0
+       powerpc-ibm-aix5.2.0.0
+       powerpc-ibm-aix5.3.0.0
        sparc-sun-solaris2.10
        sparc64-unknown-linux-deb3.0
        x86_64-unknown-linux-rh2.9.5AS
index 72a94d6f8d05c45a6f42db93eb32bf1b4a32df60..7cde8c645e44ce2dac92c752744b94f31998ea5f 100644 (file)
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: get_args.c,v 1.25 2005/01/14 04:50:38 ezk Exp $
+ * $Id: get_args.c,v 1.26 2005/02/17 03:37:42 ezk Exp $
  *
  */
 
@@ -389,9 +389,6 @@ get_args(int argc, char *argv[])
 # endif /* MNTTAB_FILE_NAME */
 #endif /* not MOUNT_TABLE_ON_FILE */
 
-    if (switch_to_logfile(gopt.logfile, orig_umask) != 0)
-      plog(XLOG_USER, "Cannot switch logfile");
-
     /*
      * If the kernel architecture was not specified
      * then use the machine architecture.
@@ -416,5 +413,8 @@ get_args(int argc, char *argv[])
     exit(0);
   }
 
+  if (switch_to_logfile(gopt.logfile, orig_umask) != 0)
+    plog(XLOG_USER, "Cannot switch logfile");
+
   return;
 }
index 953030525f765d6fb9f3e5db365beeedd15cdee4..e4a8f0bfde48aaf6208bfb8b6eab0e3ac4e6a3c6 100644 (file)
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: info_union.c,v 1.10 2005/01/03 20:56:45 ezk Exp $
+ * $Id: info_union.c,v 1.11 2005/02/17 03:37:42 ezk Exp $
  *
  */
 
@@ -133,9 +133,9 @@ union_reload(mnt_map *m, char *map, void (*fn) (mnt_map *, char *, char *))
    * Add wildcard entry
    */
   {
-    char *val = xmalloc(strlen(dir[-1]) + 5);
+    char *val = xmalloc(strlen(*(dir-1)) + 5);
 
-    sprintf(val, "fs:=%s", dir[-1]);
+    sprintf(val, "fs:=%s", *(dir-1));
     (*fn) (m, strdup("*"), val);
   }
   XFREE(mapd);
index 71ce416bc3e21d3a7aedee0358abcfd3ddece0bc..597f48ff49a8a8c7ebe53d05da6e48feb5c6e24a 100644 (file)
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: opts.c,v 1.34 2005/01/26 06:16:30 ezk Exp $
+ * $Id: opts.c,v 1.35 2005/02/17 03:37:42 ezk Exp $
  *
  */
 
@@ -488,14 +488,14 @@ split_opts(char *opts, char *mapkey)
     if (!eq)
       continue;
 
-    if (eq[-1] == '!' ||
+    if (*(eq-1) == '!' ||
        eq[1] == '=' ||
        eq[1] == '!') { /* != or == or =! */
       continue;                        /* we don't care about selectors */
     }
 
-    if (eq[-1] == ':') {       /* := */
-      eq[-1] = '\0';
+    if (*(eq-1) == ':') {      /* := */
+      *(eq-1) = '\0';
     } else {
       /* old style assignment */
       eq[0] = '\0';
@@ -618,11 +618,11 @@ eval_selectors(char *opts, char *mapkey)
      * == is SelEQ
      * =, := is VarAss
      */
-    if (eq[-1] == '!') {       /* != */
+    if (*(eq-1) == '!') {      /* != */
       vs_opt = SelNE;
-      eq[-1] = '\0';
+      *(eq-1) = '\0';
       opt = eq + 1;
-    } else if (eq[-1] == ':') {        /* := */
+    } else if (*(eq-1) == ':') {       /* := */
       continue;
     } else if (eq[1] == '=') { /* == */
       vs_opt = SelEQ;
@@ -787,9 +787,9 @@ strip_selectors(char *opts, char *mapkey)
      * == is SelEQ
      * := is VarAss
      */
-    if (eq[-1] == '!') {       /* != */
+    if (*(eq-1) == '!') {      /* != */
       vs_opt = SelNE;
-    } else if (eq[-1] == ':') {        /* := */
+    } else if (*(eq-1) == ':') {       /* := */
       vs_opt = VarAss;
     } else if (eq[1] == '=') { /* == */
       vs_opt = SelEQ;
@@ -1074,7 +1074,7 @@ expand_op(char *opt, int sel_p)
        todo = E_File;
        cp++;
        --len;
-      } else if (br_p[-1] == '/') {
+      } else if (*(br_p-1) == '/') {
        /*
         * Take all but the last component
         */
@@ -1087,7 +1087,7 @@ expand_op(char *opt, int sel_p)
        todo = E_Domain;
        cp++;
        --len;
-      } else if (br_p[-1] == '.') {
+      } else if (*(br_p-1) == '.') {
        /*
         * Take host name
         */
index 3e8d89efbe9ef6f41a91d893bb4eef0bf0983ac5..139438a62c9d8fe26dee8f579bfc7688308132ff 100644 (file)
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: checkmount_aix.c,v 1.10 2005/01/03 20:56:45 ezk Exp $
+ * $Id: checkmount_aix.c,v 1.11 2005/02/17 03:37:42 ezk Exp $
  *
  */
 
 
 /* external definitions */
 extern int is_same_host(char *name1, char *name2, struct in_addr addr2);
+#if 0
+#error no longer needed on AIX 5.3
 extern int mntctl(int Command, int Size, char *Buffer);
+#endif
 
 
 int
index 98bf6b245394f6b549e2a35e476ba1d8ee3e5d93..e1d91663668a0bf4f3ae8002d4e5ee0620680f2d 100644 (file)
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: mtab_aix.c,v 1.12 2005/01/03 20:56:45 ezk Exp $
+ * $Id: mtab_aix.c,v 1.13 2005/02/17 03:37:42 ezk Exp $
  *
  */
 
 #include <am_defs.h>
 #include <amu.h>
 
-/* missing external definitions from AIX's headers */
+/*
+ * These were missing external definitions from old AIX's headers.  They
+ * appear to be available in <sys/vmount.h> on AIX 5.3, and possibly
+ * earlier. Hence I commented this out.
+ */
+#if 0
 extern int mntctl(int cmd, int size, voidp buf);
+#endif
 
 
 static mntent_t *
index b6303070041d448c25c7d7909996063e006a16a5..b43306b1db351e84d0dd781944828881de4eb060 100644 (file)
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: hlfsd.c,v 1.30 2005/01/13 21:24:12 ezk Exp $
+ * $Id: hlfsd.c,v 1.31 2005/02/17 03:37:42 ezk Exp $
  *
  * HLFSD was written at Columbia University Computer Science Department, by
  * Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu>
@@ -382,7 +382,7 @@ main(int argc, char *argv[])
     chmod(alt_spooldir, OPEN_SPOOLMODE);
 
     /* create failsafe link to alternate spool directory */
-    slinkname[-1] = '/';       /* unsplit dir_name to include link */
+    *(slinkname-1) = '/';      /* unsplit dir_name to include link */
     if (lstat(dir_name, &stmodes) == 0 &&
        (stmodes.st_mode & S_IFMT) != S_IFLNK) {
       fprintf(stderr, "%s: failsafe %s not a symlink\n",
@@ -403,7 +403,7 @@ main(int argc, char *argv[])
       }
     }
 
-    slinkname[-1] = '\0';      /* resplit dir_name */
+    *(slinkname-1) = '\0';     /* resplit dir_name */
   } /* end of "if (!forcefast) {" */
 
   /*
index 761d5d1ba3ee80cb3167a70eb283e85006769ae5..6c05a22529decc0932ea61110eec7c6fe7af87f0 100644 (file)
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: wire.c,v 1.21 2005/01/03 20:56:46 ezk Exp $
+ * $Id: wire.c,v 1.22 2005/02/17 03:37:42 ezk Exp $
  *
  */
 
@@ -319,8 +319,8 @@ is_network_member(const char *net)
     char *netstr = strdup(net), *maskstr;
     u_long netnum, masknum = 0;
     maskstr = strchr(netstr, '/');
+    maskstr[0] = '\0';         /* null terminate netstr */
     maskstr++;
-    maskstr[-1] = '\0';                /* null terminate netstr */
     if (*maskstr == '\0')      /* if empty string, make it NULL */
       maskstr = NULL;
     /* check if netmask uses a dotted-quad or bit-length, or not defined at all */
index 334337475f569ed9119a8838581d3ea35f6e81e2..1bb032431178f05995007683b6a5eba9791f5a7f 100644 (file)
@@ -37,7 +37,7 @@
  * SUCH DAMAGE.
  *
  *
- * $Id: xutil.c,v 1.33 2005/01/03 20:56:46 ezk Exp $
+ * $Id: xutil.c,v 1.34 2005/02/17 03:37:42 ezk Exp $
  *
  */
 
@@ -451,7 +451,7 @@ real_plog(int lvl, const char *fmt, va_list vargs)
 #endif /* not HAVE_VSNPRINTF */
 
   ptr += strlen(ptr);
-  if (ptr[-1] == '\n')
+  if (*(ptr-1) == '\n')
     *--ptr = '\0';
 
 #ifdef HAVE_SYSLOG
index 550562dc3c45b586ed0632f632d521df9b424a55..11727189706550839f18b0137e51b9a808c9ebad 100644 (file)
@@ -42,6 +42,10 @@ case "${host_os}" in
                # turn on additional headers
                ac_cv_os_cflags="-D_XOPEN_EXTENDED_SOURCE"
                ;;
+       aix5.3* )
+               # avoid circular dependencies in yp headers, and more
+               ac_cv_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE -D_USE_IRS -D_MSGQSUPPORT"
+               ;;
        aix* )
                # avoid circular dependencies in yp headers
                ac_cv_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE -D_USE_IRS"