The 1.11.1 version of CVS will not compile in VMS alpha.

The attached diffs fix the following problems:

build.com - correct name of build .com for zlib
build_diff.com - turn on verify to get a better trace of the DCL
diff/diff3.c - Compiler warning.  The VMS read rval is ssize_t (signed).
The VMS size_t appears to be unsigned.
diff/io.c - Compiler warning (ssize_t)
build_lib.com - verify
lib/getdate.[yc] - more the include of xtime.h out from underneath the ifdef
so that it is always included.
src/build_src.com - add annotate.c/annotate.obj,verify, correct zlib name
src/patch.c - VMS time_t appears to be unsigned.   Add a cast when testing
for (time_t)-1
src/subr.c - #else,#endif for no symlinks should be moved.
vms/build_vms.com - verify
vms/filesubr.c - cut/paste 1.11.1 cvs_temp_file, cvs_temp_name from
src/filesubr.c.   Include assert.h so that assert's work.


The system is running:

OpenVMS V7.2-1
Compaq C V6.2-006 on OpenVMS Alpha V7.2-1

 <<vms.txt>> 


*************************************************************************** 
This electronic mail transmission contains confidential and/or privileged 
information intended only for the person(s) named.  Any use, distribution, 
copying or disclosure by another person is strictly prohibited. 
*************************************************************************** 


Index: cvs/build.com
diff -c cvs/build.com:1.1.1.1 cvs/build.com:1.2
*** cvs/build.com:1.1.1.1       Fri Jun  1 12:41:37 2001
--- cvs/build.com       Fri Jun  1 12:44:53 2001
***************
*** 1,5 ****
  $ set def [.zlib]
! $ @build_zlib.com
  $ set def [-.diff]
  $ @build_diff.com
  $ set def [-.vms]
--- 1,5 ----
  $ set def [.zlib]
! $ @make_vms.com
  $ set def [-.diff]
  $ @build_diff.com
  $ set def [-.vms]
Index: cvs/diff/build_diff.com
diff -c cvs/diff/build_diff.com:1.1.1.1 cvs/diff/build_diff.com:1.2
*** cvs/diff/build_diff.com:1.1.1.1     Fri Jun  1 12:41:42 2001
--- cvs/diff/build_diff.com     Fri Jun  1 12:47:28 2001
***************
*** 1,3 ****
--- 1,4 ----
+ $ set verify
  $ CC :== CC/DEBUG/NOOPTIMIZE/STANDARD=VAXC/DEFINE=HAVE_CONFIG_H-
  /INCLUDE_DIRECTORY=([-],[-.LIB],[-.SRC],[-.VMS])/PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES
  $ CC diff.c
***************
*** 16,18 ****
--- 17,20 ----
  $ library/create diff.olb diff.obj,analyze.obj,cmpbuf.obj,-
  dir.obj,io.obj,util.obj,context.obj,ed.obj,ifdef.obj,normal.obj,-
  side.obj,version.obj,diff3.obj
+ $ set noverify
Index: cvs/diff/diff3.c
diff -c cvs/diff/diff3.c:1.1.1.1 cvs/diff/diff3.c:1.2
*** cvs/diff/diff3.c:1.1.1.1    Fri Jun  1 12:41:42 2001
--- cvs/diff/diff3.c    Fri Jun  1 13:01:53 2001
***************
*** 1847,1856 ****
       char *ptr;
       size_t size;
  {
!   size_t result = read (fd, ptr, size);
    if (result == -1)
      diff3_perror_with_exit ("read failed");
!   return result;
  }
  
  static void
--- 1847,1856 ----
       char *ptr;
       size_t size;
  {
!   ssize_t result = read (fd, ptr, size);
    if (result == -1)
      diff3_perror_with_exit ("read failed");
!   return (size_t)result;
  }
  
  static void
Index: cvs/diff/io.c
diff -c cvs/diff/io.c:1.1.1.1 cvs/diff/io.c:1.2
*** cvs/diff/io.c:1.1.1.1       Fri Jun  1 12:41:42 2001
--- cvs/diff/io.c       Fri Jun  1 13:01:53 2001
***************
*** 101,107 ****
  #if HAVE_SETMODE
          int oldmode = setmode (current->desc, O_BINARY);
  #endif
!         size_t n = read (current->desc, current->buffer, current->bufsize);
          if (n == -1)
            pfatal_with_name (current->name);
          current->buffered_chars = n;
--- 101,107 ----
  #if HAVE_SETMODE
          int oldmode = setmode (current->desc, O_BINARY);
  #endif
!         ssize_t n = read (current->desc, current->buffer, current->bufsize);
          if (n == -1)
            pfatal_with_name (current->name);
          current->buffered_chars = n;
***************
*** 128,134 ****
  slurp (current)
       struct file_data *current;
  {
!   size_t cc;
  
    if (current->desc < 0)
      /* The file is nonexistent.  */
--- 128,134 ----
  slurp (current)
       struct file_data *current;
  {
!   ssize_t cc;
  
    if (current->desc < 0)
      /* The file is nonexistent.  */
Index: cvs/lib/build_lib.com
diff -c cvs/lib/build_lib.com:1.1.1.1 cvs/lib/build_lib.com:1.2
*** cvs/lib/build_lib.com:1.1.1.1       Fri Jun  1 12:41:41 2001
--- cvs/lib/build_lib.com       Fri Jun  1 12:49:09 2001
***************
*** 1,3 ****
--- 1,4 ----
+ $ set verify
  $ CC :== CC/DEBUG/NOOPTIMIZE/STANDARD=VAXC/DEFINE=HAVE_CONFIG_H-
  /INCLUDE_DIRECTORY=([-],[-.LIB],[-.SRC],[-.VMS])/PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES
  $ CC fnmatch.c
***************
*** 16,18 ****
--- 17,20 ----
  $ library/create gnulib.olb fnmatch.obj,getdate.obj,getline.obj,-
  getopt.obj,getopt1.obj,md5.obj,regex.obj,savecwd.obj,sighandle.obj,-
  stripslash.obj,valloc.obj,xgetwd.obj,yesno.obj
+ $ set noverify
Index: cvs/lib/getdate.c
diff -c cvs/lib/getdate.c:1.1.1.1 cvs/lib/getdate.c:1.2
*** cvs/lib/getdate.c:1.1.1.1   Fri Jun  1 12:41:41 2001
--- cvs/lib/getdate.c   Fri Jun  1 12:58:53 2001
***************
*** 63,70 ****
  # include <types.h>
  #else /* defined(vms) */
  # include <sys/types.h>
- # include "xtime.h"
  #endif        /* !defined(vms) */
  
  #if defined (STDC_HEADERS) || defined (USG)
  #include <string.h>
--- 63,70 ----
  # include <types.h>
  #else /* defined(vms) */
  # include <sys/types.h>
  #endif        /* !defined(vms) */
+ # include "xtime.h"
  
  #if defined (STDC_HEADERS) || defined (USG)
  #include <string.h>
Index: cvs/lib/getdate.y
diff -c cvs/lib/getdate.y:1.1.1.1 cvs/lib/getdate.y:1.2
*** cvs/lib/getdate.y:1.1.1.1   Fri Jun  1 12:41:41 2001
--- cvs/lib/getdate.y   Fri Jun  1 12:58:53 2001
***************
*** 42,49 ****
  # include <types.h>
  #else /* defined(vms) */
  # include <sys/types.h>
- # include "xtime.h"
  #endif        /* !defined(vms) */
  
  #if defined (STDC_HEADERS) || defined (USG)
  #include <string.h>
--- 42,49 ----
  # include <types.h>
  #else /* defined(vms) */
  # include <sys/types.h>
  #endif        /* !defined(vms) */
+ # include "xtime.h"
  
  #if defined (STDC_HEADERS) || defined (USG)
  #include <string.h>
Index: cvs/src/build_src.com
diff -c cvs/src/build_src.com:1.1.1.1 cvs/src/build_src.com:1.2
*** cvs/src/build_src.com:1.1.1.1       Fri Jun  1 12:41:39 2001
--- cvs/src/build_src.com       Fri Jun  1 12:52:15 2001
***************
*** 1,7 ****
--- 1,9 ----
+ $ set verify
  $ CC :== CC/NOOPT/DEB/STANDARD=VAXC/DEFINE=HAVE_CONFIG_H-
  /INCLUDE_DIR=([-],[-.VMS],[-.LIB])/PREFIX=ALL
  $ CC add.c
  $ CC admin.c
+ $ CC annotate.c
  $ CC buffer.c
  $ CC checkin.c
  $ CC checkout.c
***************
*** 51,57 ****
  $ CC watch.c
  $ CC wrapper.c
  $ CC/INCLUDE_DIR=([-],[-.VMS],[-.LIB],[-.zlib]) zlib.c
! $ LIBRARY/CREATE cvslib.olb add.obj,admin.obj,buffer.obj,checkin.obj,-
  checkout.obj,-
  classify.obj,client.obj,commit.obj,create_adm.obj,cvsrc.obj,-
  diff.obj,edit.obj,entries.obj,error.obj,expand_path.obj,fileattr.obj,-
--- 53,59 ----
  $ CC watch.c
  $ CC wrapper.c
  $ CC/INCLUDE_DIR=([-],[-.VMS],[-.LIB],[-.zlib]) zlib.c
! $ LIBRARY/CREATE cvslib.olb add.obj,admin.obj,annotate.obj,buffer.obj,checkin.obj,-
  checkout.obj,-
  classify.obj,client.obj,commit.obj,create_adm.obj,cvsrc.obj,-
  diff.obj,edit.obj,entries.obj,error.obj,expand_path.obj,fileattr.obj,-
***************
*** 64,67 ****
  subr.obj,tag.obj,update.obj,version.obj,vers_ts.obj,watch.obj,wrapper.obj,-
  zlib.obj
  $ link/nodeb/exe=cvs.exe main.obj,cvslib.olb/lib,[-.vms]openvmslib.olb/lib,-
!     [-.zlib]zlib.olb/lib,[-.diff]diff.olb/lib,[-.lib]gnulib.olb/lib
--- 66,70 ----
  subr.obj,tag.obj,update.obj,version.obj,vers_ts.obj,watch.obj,wrapper.obj,-
  zlib.obj
  $ link/nodeb/exe=cvs.exe main.obj,cvslib.olb/lib,[-.vms]openvmslib.olb/lib,-
!     [-.zlib]libz.olb/lib,[-.diff]diff.olb/lib,[-.lib]gnulib.olb/lib
! $ set noverify
Index: cvs/src/patch.c
diff -c cvs/src/patch.c:1.1.1.1 cvs/src/patch.c:1.2
*** cvs/src/patch.c:1.1.1.1     Fri Jun  1 12:41:38 2001
--- cvs/src/patch.c     Fri Jun  1 13:00:38 2001
***************
*** 432,438 ****
        if (!date1)
            date1 = xmalloc (MAXDATELEN);
        *date1 = '\0';
!       if (RCS_getrevtime (rcsfile, vers_head, date1, 1) == -1)
        {
            if (!really_quiet)
                error (0, 0, "cannot find date in rcs file %s revision %s",
--- 432,438 ----
        if (!date1)
            date1 = xmalloc (MAXDATELEN);
        *date1 = '\0';
!       if (RCS_getrevtime (rcsfile, vers_head, date1, 1) == (time_t)-1)
        {
            if (!really_quiet)
                error (0, 0, "cannot find date in rcs file %s revision %s",
Index: cvs/src/subr.c
diff -c cvs/src/subr.c:1.1.1.1 cvs/src/subr.c:1.3
*** cvs/src/subr.c:1.1.1.1      Fri Jun  1 12:41:39 2001
--- cvs/src/subr.c      Fri Jun  1 13:08:42 2001
***************
*** 742,750 ****
           But that would require editing each filesubr.c and so the
           expedient hack seems to be looking at HAVE_READLINK.  */
        newname = xreadlink (*filename);
- #else
-       error (1, 0, "internal error: islink doesn't like readlink");
- #endif
        
        if (isabsolute (newname))
        {
--- 745,750 ----
***************
*** 762,767 ****
--- 762,770 ----
            free (*filename);
            *filename = fullnewname;
        }
+ #else
+       error (1, 0, "internal error: islink doesn't like readlink");
+ #endif
      }
  }
  
Index: cvs/vms/build_vms.com
diff -c cvs/vms/build_vms.com:1.1.1.1 cvs/vms/build_vms.com:1.2
*** cvs/vms/build_vms.com:1.1.1.1       Fri Jun  1 12:41:43 2001
--- cvs/vms/build_vms.com       Fri Jun  1 12:53:42 2001
***************
*** 1,3 ****
--- 1,4 ----
+ $ set verify
  $ CC :== CC/DEBUG/NOOPTIMIZE/STANDARD=VAXC/DEFINE=HAVE_CONFIG_H-
  /INCLUDE_DIRECTORY=([-],[-.LIB],[-.SRC],[-.VMS])/PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES
  $ CC filesubr.c
***************
*** 22,24 ****
--- 23,26 ----
  filutils.obj,getpass.obj,getwd.obj,misc.obj,ndir.obj,pipe.obj,-
  pwd.obj,rcmd.obj,readlink.obj,rmdir.obj,stat.obj,startserver.obj,-
  unlink.obj,utime.obj,vmsmunch.obj,waitpid.obj
+ $ set noverify
Index: cvs/vms/filesubr.c
diff -c cvs/vms/filesubr.c:1.1.1.1 cvs/vms/filesubr.c:1.2
*** cvs/vms/filesubr.c:1.1.1.1  Fri Jun  1 12:41:43 2001
--- cvs/vms/filesubr.c  Fri Jun  1 12:57:31 2001
***************
*** 17,22 ****
--- 17,23 ----
     GNU General Public License for more details.  */
  
  #include "cvs.h"
+ #include <assert.h>
  
  static int deep_remove_dir PROTO((const char *path));
  
***************
*** 641,647 ****
            if (read2 == (size_t)-1)
                error (1, errno, "cannot read file %s for comparing", file2);
  
!           /* assert (read1 == read2); */
  
            ret = memcmp(buf1, buf2, read1);
        } while (ret == 0 && read1 == buf_size);
--- 642,648 ----
            if (read2 == (size_t)-1)
                error (1, errno, "cannot read file %s for comparing", file2);
  
!           assert (read1 == read2);
  
            ret = memcmp(buf1, buf2, read1);
        } while (ret == 0 && read1 == buf_size);
***************
*** 733,751 ****
  }
  
  /* Generate a unique temporary filename.  Returns a pointer to a newly
!    malloc'd string containing the name.  Returns successfully or not at
!    all.  */
  char *
  cvs_temp_name ()
  {
!     char value[L_tmpnam + 1];
!     char *retval;
  
!     /* FIXME: what is the VMS equivalent to TMPDIR?  */
!     retval = tmpnam (value);
!     if (retval == NULL)
!       error (1, errno, "cannot generate temporary filename");
!     return xstrdup (retval);
  }
  
  /* Return non-zero iff FILENAME is absolute.
--- 734,898 ----
  }
  
  /* Generate a unique temporary filename.  Returns a pointer to a newly
!  * malloc'd string containing the name.  Returns successfully or not at
!  * all.
!  *
!  *     THIS FUNCTION IS DEPRECATED!!!  USE cvs_temp_file INSTEAD!!!
!  *
!  * and yes, I know about the way the rcs commands use temp files.  I think
!  * they should be converted too but I don't have time to look into it right
!  * now.
!  */
  char *
  cvs_temp_name ()
  {
!     char *fn;
!     FILE *fp;
! 
!     fp = cvs_temp_file (&fn);
!     if (fp == NULL)
!       error (1, errno, "Failed to create temporary file");
!     if (fclose (fp) == EOF)
!       error (0, errno, "Failed to close temporary file %s", fn);
!     return fn;
! }
! 
! /* Generate a unique temporary filename and return an open file stream
!  * to the truncated file by that name
!  *
!  *  INPUTS
!  *    filename        where to place the pointer to the newly allocated file
!  *                    name string
!  *
!  *  OUTPUTS
!  *    filename        dereferenced, will point to the newly allocated file
!  *                    name string.  This value is undefined if the function
!  *                    returns an error.
!  *
!  *  RETURNS
!  *    An open file pointer to a read/write mode empty temporary file with the
!  *    unique file name or NULL on failure.
!  *
!  *  ERRORS
!  *    on error, errno will be set to some value either by CVS_FOPEN or
!  *    whatever system function is called to generate the temporary file name
!  */
! /* There are at least four functions for generating temporary
!  * filenames.  We use mkstemp (BSD 4.3) if possible, else tempnam (SVID 3),
!  * else mktemp (BSD 4.3), and as last resort tmpnam (POSIX).  Reason is that
!  * mkstemp, tempnam, and mktemp both allow to specify the directory in which
!  * the temporary file will be created.
!  *
!  * And the _correct_ way to use the deprecated functions probably involves
!  * opening file descriptors using O_EXCL & O_CREAT and even doing the annoying
!  * NFS locking thing, but until I hear of more problems, I'm not going to
!  * bother.
!  */
! FILE *cvs_temp_file (filename)
!     char **filename;
! {
!     char *fn;
!     FILE *fp;
! 
!     /* FIXME - I'd like to be returning NULL here in noexec mode, but I think
!      * some of the rcs & diff functions which rely on a temp file run in
!      * noexec mode too.
!      */
! 
!     assert (filename != NULL);
! 
! #ifdef HAVE_MKSTEMP
! 
!     {
!     int fd;
! 
!     fn = xmalloc (strlen (Tmpdir) + 11);
!     sprintf (fn, "%s/%s", Tmpdir, "cvsXXXXXX" );
!     fd = mkstemp (fn);
! 
!     /* a NULL return will be interpreted by callers as an error and
!      * errno should still be set
!      */
!     if (fd == -1) fp = NULL;
!     else if ((fp = CVS_FDOPEN (fd, "w+")) == NULL)
!     {
!       /* attempt to close and unlink the file since mkstemp returned sucessfully and
!        * we believe it's been created and opened
!        */
!       int save_errno = errno;
!       if (close (fd))
!           error (0, errno, "Failed to close temporary file %s", fn);
!       if (CVS_UNLINK (fn))
!           error (0, errno, "Failed to unlink temporary file %s", fn);
!       errno = save_errno;
!     }
! 
!     if (fp == NULL) free (fn);
!     /* mkstemp is defined to open mode 0600 using glibc 2.0.7+ */
!     /* FIXME - configure can probably tell us which version of glibc we are
!      * linking to and not chmod for 2.0.7+
!      */
!     else chmod (fn, 0600);
! 
!     }
! 
! #elif HAVE_TEMPNAM
! 
!     /* tempnam has been deprecated due to under-specification */
! 
!     fn = tempnam (Tmpdir, "cvs");
!     if (fn == NULL) fp = NULL;
!     else if ((fp = CVS_FOPEN (fn, "w+")) == NULL) free (fn);
!     else chmod (fn, 0600);
! 
!     /* tempnam returns a pointer to a newly malloc'd string, so there's
!      * no need for a xstrdup
!      */
! 
! #elif HAVE_MKTEMP
! 
!     /* mktemp has been deprecated due to the BSD 4.3 specification specifying
!      * that XXXXXX will be replaced by a PID and a letter, creating only 26
!      * possibilities, a security risk, and a race condition.
!      */
! 
!     {
!     char *ifn;
! 
!     ifn = xmalloc (strlen (Tmpdir) + 11);
!     sprintf (ifn, "%s/%s", Tmpdir, "cvsXXXXXX" );
!     fn = mktemp (ifn);
! 
!     if (fn == NULL) fp = NULL;
!     else fp = CVS_FOPEN (fn, "w+");
! 
!     if (fp == NULL) free (ifn);
!     else chmod (fn, 0600);
! 
!     }
! 
! #else /* use tmpnam if all else fails */
! 
!     /* tmpnam is deprecated */
! 
!     {
!     char ifn[L_tmpnam + 1];
! 
!     fn = tmpnam (ifn);
! 
!     if (fn == NULL) fp = NULL;
!     else if ((fp = CVS_FOPEN (ifn, "w+")) != NULL)
!     {
!       fn = xstrdup (ifn);
!       chmod (fn, 0600);
!     }
! 
!     }
! 
! #endif
  
!     *filename = fn;
!     return fp;
  }
  
  /* Return non-zero iff FILENAME is absolute.
Index: cvs/zlib/Make_vms.com
diff -c cvs/zlib/Make_vms.com:1.1.1.1 cvs/zlib/Make_vms.com:1.2
*** cvs/zlib/Make_vms.com:1.1.1.1       Fri Jun  1 12:41:40 2001
--- cvs/zlib/Make_vms.com       Fri Jun  1 13:35:06 2001
***************
*** 61,72 ****
  $   CALL MAKE example.OBJ "CC ''CCOPT' example" -
                  example.c zlib.h zconf.h
  $   call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
! $   write sys$output "Building minigzip..."
! $   CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" -
!                 minigzip.c zlib.h zconf.h
! $   call make minigzip.exe - 
!                 "LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" - 
!                 minigzip.obj libz.olb
  $  else
  $   mms/macro=('comp')
  $  endif
--- 61,72 ----
  $   CALL MAKE example.OBJ "CC ''CCOPT' example" -
                  example.c zlib.h zconf.h
  $   call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
! $!   write sys$output "Building minigzip..."
! $!   CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" -
! $!              minigzip.c zlib.h zconf.h
! $!  call make minigzip.exe - 
! $!              "LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" - 
! $!              minigzip.obj libz.olb
  $  else
  $   mms/macro=('comp')
  $  endif

Reply via email to