Karsten Hopp 2dd8d4
To: vim-dev@vim.org
Karsten Hopp 2dd8d4
Subject: patch 7.0.202
Karsten Hopp 2dd8d4
Fcc: outbox
Karsten Hopp 2dd8d4
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 2dd8d4
Mime-Version: 1.0
Karsten Hopp 2dd8d4
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 2dd8d4
Content-Transfer-Encoding: 8bit
Karsten Hopp 2dd8d4
------------
Karsten Hopp 2dd8d4
Karsten Hopp 2dd8d4
Patch 7.0.202
Karsten Hopp 2dd8d4
Problem:    Problems on Tandem systems while compiling and at runtime.
Karsten Hopp 2dd8d4
Solution:   Recognize root uid is 65535.  Check select() return value for it
Karsten Hopp 2dd8d4
	    not being supported.  Avoid wrong function prototypes.  Mention
Karsten Hopp 2dd8d4
	    use of -lfloss.  (Matthew Woehlke)
Karsten Hopp 2dd8d4
Files:	    src/Makefile, src/ex_cmds.c, src/fileio.c, src/main.c,
Karsten Hopp 2dd8d4
	    src/osdef1.h.in, src/osdef2.h.in, src/os_unix.c, src/pty.c,
Karsten Hopp 2dd8d4
	    src/vim.h
Karsten Hopp 2dd8d4
Karsten Hopp 2dd8d4
Karsten Hopp 2dd8d4
*** ../vim-7.0.201/src/Makefile	Tue Feb 20 04:46:41 2007
Karsten Hopp 2dd8d4
--- src/Makefile	Tue Feb 27 10:24:05 2007
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 201,206 ****
Karsten Hopp 2dd8d4
--- 201,207 ----
Karsten Hopp 2dd8d4
  #SunOS 4.1.x			     +X11 -GUI		5.1b (J) Bram Moolenaar
Karsten Hopp 2dd8d4
  #SunOS 4.1.3_U1 (sun4c) gcc	     +X11 +GUI Athena	5.0w (J) Darren Hiebert
Karsten Hopp 2dd8d4
  #SUPER-UX 6.2 (NEC SX-4) cc	     +X11R6 Motif,Athena4.6b (P) Lennart Schultz
Karsten Hopp 2dd8d4
+ #Tandem/NSK                                                  (c) Matthew Woehlke
Karsten Hopp 2dd8d4
  #Unisys 6035	      cc	     +X11 Motif		5.3  (8) Glauber Ribeiro
Karsten Hopp 2dd8d4
  #ESIX V4.2	      cc	     +X11		6.0  (a) Reinhard Wobst
Karsten Hopp 2dd8d4
  #Mac OS X 10.[23]     gcc	     Carbon		6.2  (x) Bram Moolenaar
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 251,256 ****
Karsten Hopp 2dd8d4
--- 252,258 ----
Karsten Hopp 2dd8d4
  # (a)  See line with EXTRA_LIBS below.
Karsten Hopp 2dd8d4
  # (b)  When using gcc with the Solaris linker, make sure you don't use GNU
Karsten Hopp 2dd8d4
  #      strip, otherwise the binary may not run: "Cannot find ELF".
Karsten Hopp 2dd8d4
+ # (c)  Add -lfloss to EXTRA_LIBS, see below.
Karsten Hopp 2dd8d4
  # (x)  When you get warnings for precompiled header files, run
Karsten Hopp 2dd8d4
  #      "sudo fixPrecomps".  Also see CONF_OPT_DARWIN below.
Karsten Hopp 2dd8d4
  # }}}
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 793,798 ****
Karsten Hopp 2dd8d4
--- 796,804 ----
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
  ### (a)  ESIX V4.2 (Reinhard Wobst)
Karsten Hopp 2dd8d4
  #EXTRA_LIBS = -lnsl -lsocket -lgen -lXIM -lXmu -lXext
Karsten Hopp 2dd8d4
+ 
Karsten Hopp 2dd8d4
+ ### (c)  Tandem/NSK (Matthew Woehlke)
Karsten Hopp 2dd8d4
+ #EXTRA_LIBS = -lfloss
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
  ### If you want to use ncurses library instead of the automatically found one
Karsten Hopp 2dd8d4
  ### after changing this, you need to do "make reconfig".
Karsten Hopp 2dd8d4
*** ../vim-7.0.201/src/ex_cmds.c	Tue Feb 13 03:49:01 2007
Karsten Hopp 2dd8d4
--- src/ex_cmds.c	Tue Feb 20 05:20:55 2007
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 1772,1778 ****
Karsten Hopp 2dd8d4
  	 */
Karsten Hopp 2dd8d4
  	st_old.st_dev = st_old.st_ino = 0;
Karsten Hopp 2dd8d4
  	st_old.st_mode = 0600;
Karsten Hopp 2dd8d4
! 	if (mch_stat((char *)fname, &st_old) == 0 && getuid()
Karsten Hopp 2dd8d4
  		&& !(st_old.st_uid == getuid()
Karsten Hopp 2dd8d4
  			? (st_old.st_mode & 0200)
Karsten Hopp 2dd8d4
  			: (st_old.st_gid == getgid()
Karsten Hopp 2dd8d4
--- 1772,1779 ----
Karsten Hopp 2dd8d4
  	 */
Karsten Hopp 2dd8d4
  	st_old.st_dev = st_old.st_ino = 0;
Karsten Hopp 2dd8d4
  	st_old.st_mode = 0600;
Karsten Hopp 2dd8d4
! 	if (mch_stat((char *)fname, &st_old) == 0
Karsten Hopp 2dd8d4
! 		&& getuid() != ROOT_UID
Karsten Hopp 2dd8d4
  		&& !(st_old.st_uid == getuid()
Karsten Hopp 2dd8d4
  			? (st_old.st_mode & 0200)
Karsten Hopp 2dd8d4
  			: (st_old.st_gid == getgid()
Karsten Hopp 2dd8d4
*** ../vim-7.0.201/src/fileio.c	Tue Jan 16 21:31:38 2007
Karsten Hopp 2dd8d4
--- src/fileio.c	Wed Feb 21 06:04:39 2007
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 1122,1128 ****
Karsten Hopp 2dd8d4
  	    if (!skip_read)
Karsten Hopp 2dd8d4
  	    {
Karsten Hopp 2dd8d4
  #if SIZEOF_INT > 2
Karsten Hopp 2dd8d4
! # ifdef __TANDEM
Karsten Hopp 2dd8d4
  		size = SSIZE_MAX;		    /* use max I/O size, 52K */
Karsten Hopp 2dd8d4
  # else
Karsten Hopp 2dd8d4
  		size = 0x10000L;		    /* use buffer >= 64K */
Karsten Hopp 2dd8d4
--- 1122,1128 ----
Karsten Hopp 2dd8d4
  	    if (!skip_read)
Karsten Hopp 2dd8d4
  	    {
Karsten Hopp 2dd8d4
  #if SIZEOF_INT > 2
Karsten Hopp 2dd8d4
! # if defined(SSIZE_MAX) && (SSIZE_MAX < 0x10000L)
Karsten Hopp 2dd8d4
  		size = SSIZE_MAX;		    /* use max I/O size, 52K */
Karsten Hopp 2dd8d4
  # else
Karsten Hopp 2dd8d4
  		size = 0x10000L;		    /* use buffer >= 64K */
Karsten Hopp 2dd8d4
*** ../vim-7.0.201/src/main.c	Tue Nov  7 22:41:37 2006
Karsten Hopp 2dd8d4
--- src/main.c	Tue Feb 20 05:22:33 2007
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 3280,3286 ****
Karsten Hopp 2dd8d4
  #  ifdef FEAT_GUI
Karsten Hopp 2dd8d4
  		(gui.in_use
Karsten Hopp 2dd8d4
  #   ifdef UNIX
Karsten Hopp 2dd8d4
! 		 && getuid() != 0
Karsten Hopp 2dd8d4
  #   endif
Karsten Hopp 2dd8d4
  		) ||
Karsten Hopp 2dd8d4
  #  endif
Karsten Hopp 2dd8d4
--- 3280,3286 ----
Karsten Hopp 2dd8d4
  #  ifdef FEAT_GUI
Karsten Hopp 2dd8d4
  		(gui.in_use
Karsten Hopp 2dd8d4
  #   ifdef UNIX
Karsten Hopp 2dd8d4
! 		 && getuid() != ROOT_UID
Karsten Hopp 2dd8d4
  #   endif
Karsten Hopp 2dd8d4
  		) ||
Karsten Hopp 2dd8d4
  #  endif
Karsten Hopp 2dd8d4
*** ../vim-7.0.201/src/osdef1.h.in	Sun Jun 13 21:14:18 2004
Karsten Hopp 2dd8d4
--- src/osdef1.h.in	Tue Feb 20 05:13:23 2007
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 98,104 ****
Karsten Hopp 2dd8d4
--- 98,106 ----
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
  #ifndef USE_SYSTEM
Karsten Hopp 2dd8d4
  extern int	fork __ARGS((void));
Karsten Hopp 2dd8d4
+ # ifndef __TANDEM
Karsten Hopp 2dd8d4
  extern int	execvp __ARGS((const char *, const char **));
Karsten Hopp 2dd8d4
+ # endif
Karsten Hopp 2dd8d4
  extern int	wait __ARGS((int *)); /* will this break things ...? */
Karsten Hopp 2dd8d4
  extern int	waitpid __ARGS((pid_t, int *, int));
Karsten Hopp 2dd8d4
  #endif
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 123,132 ****
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
  extern int	kill __ARGS((int, int));
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
  extern int	access __ARGS((char *, int));
Karsten Hopp 2dd8d4
  extern int	fsync __ARGS((int));
Karsten Hopp 2dd8d4
  extern int	fchown __ARGS((int, int, int));
Karsten Hopp 2dd8d4
! #if defined(HAVE_GETCWD) && !defined(sun)
Karsten Hopp 2dd8d4
  extern char	*getcwd __ARGS((char *, int));
Karsten Hopp 2dd8d4
  #else
Karsten Hopp 2dd8d4
  extern char	*getwd __ARGS((char *));
Karsten Hopp 2dd8d4
--- 125,136 ----
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
  extern int	kill __ARGS((int, int));
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
+ #ifndef __TANDEM
Karsten Hopp 2dd8d4
  extern int	access __ARGS((char *, int));
Karsten Hopp 2dd8d4
+ #endif
Karsten Hopp 2dd8d4
  extern int	fsync __ARGS((int));
Karsten Hopp 2dd8d4
  extern int	fchown __ARGS((int, int, int));
Karsten Hopp 2dd8d4
! #if defined(HAVE_GETCWD) && !defined(sun) && !defined(__TANDEM)
Karsten Hopp 2dd8d4
  extern char	*getcwd __ARGS((char *, int));
Karsten Hopp 2dd8d4
  #else
Karsten Hopp 2dd8d4
  extern char	*getwd __ARGS((char *));
Karsten Hopp 2dd8d4
*** ../vim-7.0.201/src/osdef2.h.in	Sun Jun 13 17:19:40 2004
Karsten Hopp 2dd8d4
--- src/osdef2.h.in	Tue Feb 20 05:14:50 2007
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 11,23 ****
Karsten Hopp 2dd8d4
--- 11,29 ----
Karsten Hopp 2dd8d4
  extern int	setenv __ARGS((char *, char *, int));
Karsten Hopp 2dd8d4
  extern int	putenv __ARGS((const char *));
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
+ #ifndef __TANDEM
Karsten Hopp 2dd8d4
  extern int	gethostname __ARGS((char *, int));
Karsten Hopp 2dd8d4
+ #endif
Karsten Hopp 2dd8d4
  extern void	perror __ARGS((char *));
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
+ #ifndef __TANDEM
Karsten Hopp 2dd8d4
  extern int	sleep __ARGS((int));
Karsten Hopp 2dd8d4
+ #endif
Karsten Hopp 2dd8d4
  extern int	usleep __ARGS((unsigned int));
Karsten Hopp 2dd8d4
  extern unsigned int	alarm __ARGS((unsigned int));
Karsten Hopp 2dd8d4
+ #ifndef __TANDEM
Karsten Hopp 2dd8d4
  extern int	chdir __ARGS((char *));
Karsten Hopp 2dd8d4
+ #endif
Karsten Hopp 2dd8d4
  extern int	fchdir __ARGS((int));
Karsten Hopp 2dd8d4
  #ifndef stat	/* could be redefined to stat64() */
Karsten Hopp 2dd8d4
  extern int	stat __ARGS((const char *, struct stat *));
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 28,35 ****
Karsten Hopp 2dd8d4
--- 34,43 ----
Karsten Hopp 2dd8d4
  extern int	fstat __ARGS((int, struct stat *));
Karsten Hopp 2dd8d4
  extern int	open __ARGS((const char *, int, ...));
Karsten Hopp 2dd8d4
  extern int	close __ARGS((int));
Karsten Hopp 2dd8d4
+ #ifndef __TANDEM
Karsten Hopp 2dd8d4
  extern int	read __ARGS((int, char *, size_t));
Karsten Hopp 2dd8d4
  extern int	write __ARGS((int, char *, size_t));
Karsten Hopp 2dd8d4
+ #endif
Karsten Hopp 2dd8d4
  extern int	pipe __ARGS((int *));
Karsten Hopp 2dd8d4
  extern off_t	lseek __ARGS((int, off_t, int));
Karsten Hopp 2dd8d4
  extern void	sync __ARGS((void));
Karsten Hopp 2dd8d4
*** ../vim-7.0.201/src/os_unix.c	Tue Jan  9 15:15:36 2007
Karsten Hopp 2dd8d4
--- src/os_unix.c	Tue Feb 20 05:17:23 2007
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 25,31 ****
Karsten Hopp 2dd8d4
   * Don't use it for the Mac, it causes a warning for precompiled headers.
Karsten Hopp 2dd8d4
   * TODO: use a configure check for precompiled headers?
Karsten Hopp 2dd8d4
   */
Karsten Hopp 2dd8d4
! #ifndef __APPLE__
Karsten Hopp 2dd8d4
  # define select select_declared_wrong
Karsten Hopp 2dd8d4
  #endif
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
--- 25,31 ----
Karsten Hopp 2dd8d4
   * Don't use it for the Mac, it causes a warning for precompiled headers.
Karsten Hopp 2dd8d4
   * TODO: use a configure check for precompiled headers?
Karsten Hopp 2dd8d4
   */
Karsten Hopp 2dd8d4
! #if !defined(__APPLE__) && !defined(__TANDEM)
Karsten Hopp 2dd8d4
  # define select select_declared_wrong
Karsten Hopp 2dd8d4
  #endif
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 48,56 ****
Karsten Hopp 2dd8d4
  /*
Karsten Hopp 2dd8d4
   * Use this prototype for select, some include files have a wrong prototype
Karsten Hopp 2dd8d4
   */
Karsten Hopp 2dd8d4
! #undef select
Karsten Hopp 2dd8d4
! #ifdef __BEOS__
Karsten Hopp 2dd8d4
! # define select	beos_select
Karsten Hopp 2dd8d4
  #endif
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
  #if defined(HAVE_SELECT)
Karsten Hopp 2dd8d4
--- 48,58 ----
Karsten Hopp 2dd8d4
  /*
Karsten Hopp 2dd8d4
   * Use this prototype for select, some include files have a wrong prototype
Karsten Hopp 2dd8d4
   */
Karsten Hopp 2dd8d4
! #ifndef __TANDEM
Karsten Hopp 2dd8d4
! # undef select
Karsten Hopp 2dd8d4
! # ifdef __BEOS__
Karsten Hopp 2dd8d4
! #  define select	beos_select
Karsten Hopp 2dd8d4
! # endif
Karsten Hopp 2dd8d4
  #endif
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
  #if defined(HAVE_SELECT)
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 4770,4775 ****
Karsten Hopp 2dd8d4
--- 4772,4785 ----
Karsten Hopp 2dd8d4
  # else
Karsten Hopp 2dd8d4
  	ret = select(maxfd + 1, &rfds, NULL, &efds, tvp);
Karsten Hopp 2dd8d4
  # endif
Karsten Hopp 2dd8d4
+ # ifdef __TANDEM
Karsten Hopp 2dd8d4
+ 	if (ret == -1 && errno == ENOTSUP)
Karsten Hopp 2dd8d4
+ 	{
Karsten Hopp 2dd8d4
+ 	    FD_ZERO(&rfds);
Karsten Hopp 2dd8d4
+ 	    FD_ZERO(&efds);
Karsten Hopp 2dd8d4
+ 	    ret = 0;
Karsten Hopp 2dd8d4
+ 	}
Karsten Hopp 2dd8d4
+ #endif
Karsten Hopp 2dd8d4
  # ifdef FEAT_MZSCHEME
Karsten Hopp 2dd8d4
  	if (ret == 0 && mzquantum_used)
Karsten Hopp 2dd8d4
  	    /* loop if MzThreads must be scheduled and timeout occured */
Karsten Hopp 2dd8d4
*** ../vim-7.0.201/src/pty.c	Wed Nov  1 18:12:46 2006
Karsten Hopp 2dd8d4
--- src/pty.c	Tue Feb 20 05:21:22 2007
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 330,336 ****
Karsten Hopp 2dd8d4
      if ((f = open("/dev/ptc", O_RDWR | O_NOCTTY | O_EXTRA)) < 0)
Karsten Hopp 2dd8d4
  	return -1;
Karsten Hopp 2dd8d4
      strncpy(TtyName, ttyname(f), sizeof(TtyName));
Karsten Hopp 2dd8d4
!     if (geteuid() && mch_access(TtyName, R_OK | W_OK))
Karsten Hopp 2dd8d4
      {
Karsten Hopp 2dd8d4
  	close(f);
Karsten Hopp 2dd8d4
  	return -1;
Karsten Hopp 2dd8d4
--- 330,336 ----
Karsten Hopp 2dd8d4
      if ((f = open("/dev/ptc", O_RDWR | O_NOCTTY | O_EXTRA)) < 0)
Karsten Hopp 2dd8d4
  	return -1;
Karsten Hopp 2dd8d4
      strncpy(TtyName, ttyname(f), sizeof(TtyName));
Karsten Hopp 2dd8d4
!     if (geteuid() != ROOT_UID && mch_access(TtyName, R_OK | W_OK))
Karsten Hopp 2dd8d4
      {
Karsten Hopp 2dd8d4
  	close(f);
Karsten Hopp 2dd8d4
  	return -1;
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 394,400 ****
Karsten Hopp 2dd8d4
  	    q[0] = *l;
Karsten Hopp 2dd8d4
  	    q[1] = *d;
Karsten Hopp 2dd8d4
  #ifndef MACOS
Karsten Hopp 2dd8d4
! 	    if (geteuid() && mch_access(TtyName, R_OK | W_OK))
Karsten Hopp 2dd8d4
  	    {
Karsten Hopp 2dd8d4
  		close(f);
Karsten Hopp 2dd8d4
  		continue;
Karsten Hopp 2dd8d4
--- 394,400 ----
Karsten Hopp 2dd8d4
  	    q[0] = *l;
Karsten Hopp 2dd8d4
  	    q[1] = *d;
Karsten Hopp 2dd8d4
  #ifndef MACOS
Karsten Hopp 2dd8d4
! 	    if (geteuid() != ROOT_UID && mch_access(TtyName, R_OK | W_OK))
Karsten Hopp 2dd8d4
  	    {
Karsten Hopp 2dd8d4
  		close(f);
Karsten Hopp 2dd8d4
  		continue;
Karsten Hopp 2dd8d4
*** ../vim-7.0.201/src/vim.h	Tue Jan 16 21:31:38 2007
Karsten Hopp 2dd8d4
--- src/vim.h	Tue Feb 20 05:23:47 2007
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 50,55 ****
Karsten Hopp 2dd8d4
--- 50,64 ----
Karsten Hopp 2dd8d4
  # endif
Karsten Hopp 2dd8d4
  #endif
Karsten Hopp 2dd8d4
  
Karsten Hopp 2dd8d4
+ /* user ID of root is usually zero, but not for everybody */
Karsten Hopp 2dd8d4
+ #ifdef __TANDEM
Karsten Hopp 2dd8d4
+ # define _TANDEM_SOURCE
Karsten Hopp 2dd8d4
+ # include <floss.h>
Karsten Hopp 2dd8d4
+ # define ROOT_UID 65535
Karsten Hopp 2dd8d4
+ #else
Karsten Hopp 2dd8d4
+ # define ROOT_UID 0
Karsten Hopp 2dd8d4
+ #endif
Karsten Hopp 2dd8d4
+ 
Karsten Hopp 2dd8d4
  #ifdef __EMX__		/* hand-edited config.h for OS/2 with EMX */
Karsten Hopp 2dd8d4
  # include "os_os2_cfg.h"
Karsten Hopp 2dd8d4
  #endif
Karsten Hopp 2dd8d4
*** ../vim-7.0.201/src/version.c	Tue Feb 20 04:46:32 2007
Karsten Hopp 2dd8d4
--- src/version.c	Tue Feb 27 16:44:14 2007
Karsten Hopp 2dd8d4
***************
Karsten Hopp 2dd8d4
*** 668,669 ****
Karsten Hopp 2dd8d4
--- 668,671 ----
Karsten Hopp 2dd8d4
  {   /* Add new patch number below this line */
Karsten Hopp 2dd8d4
+ /**/
Karsten Hopp 2dd8d4
+     202,
Karsten Hopp 2dd8d4
  /**/
Karsten Hopp 2dd8d4
Karsten Hopp 2dd8d4
-- 
Karsten Hopp 2dd8d4
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 2dd8d4
214. Your MCI "Circle of Friends" are all Hayes-compatible.
Karsten Hopp 2dd8d4
Karsten Hopp 2dd8d4
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 2dd8d4
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 2dd8d4
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 2dd8d4
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///