*** Makefile.in.orig	Thu May 11 13:01:49 2000
--- Makefile.in	Thu May 11 13:05:08 2000
***************
*** 71,84 ****
  	$(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(DEFS) $(OPTIONS) $(CFLAGS) $<
  
  install_bin: .version screen
! 	-if [ -f $(bindir)/$(SCREEN) ] && [ ! -f $(bindir)/$(SCREEN).old ]; \
! 		then mv $(bindir)/$(SCREEN) $(bindir)/$(SCREEN).old; fi
  	$(INSTALL_PROGRAM) screen $(bindir)/$(SCREEN)
! 	-chown root $(bindir)/$(SCREEN) && chmod 4755 $(bindir)/$(SCREEN)
  # This doesn't work if $(bindir)/screen is a symlink
  	-if [ -f $(bindir)/screen ] && [ ! -f $(bindir)/screen.old ]; then mv $(bindir)/screen $(bindir)/screen.old; fi
  	rm -f $(bindir)/screen
! 	ln -s $(SCREEN) $(bindir)/screen
  
  ###############################################################################
  install: installdirs install_bin
--- 71,84 ----
  	$(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(DEFS) $(OPTIONS) $(CFLAGS) $<
  
  install_bin: .version screen
! 	-if [ -f $(bindir)/$(SCREEN).exe ] && [ ! -f $(bindir)/$(SCREEN).old.exe ]; \
! 		then mv $(bindir)/$(SCREEN).exe $(bindir)/$(SCREEN).old.exe; fi
  	$(INSTALL_PROGRAM) screen $(bindir)/$(SCREEN)
! 	-chown root $(bindir)/$(SCREEN).exe && chmod 4755 $(bindir)/$(SCREEN).exe
  # This doesn't work if $(bindir)/screen is a symlink
  	-if [ -f $(bindir)/screen ] && [ ! -f $(bindir)/screen.old ]; then mv $(bindir)/screen $(bindir)/screen.old; fi
  	rm -f $(bindir)/screen
! 	ln -s $(SCREEN).exe $(bindir)/screen
  
  ###############################################################################
  install: installdirs install_bin
*** loadav.c.orig	Sat Mar 27 13:19:41 1999
--- loadav.c	Thu May 11 12:55:07 2000
***************
*** 56,62 ****
  
  /***************************************************************/
  
! #if defined(linux) && !defined(LOADAV_DONE)
  #define LOADAV_DONE
  /*
   * This is the easy way. It relies in /proc being mounted.
--- 56,62 ----
  
  /***************************************************************/
  
! #if (defined(__CYGWIN__) || defined(linux)) && !defined(LOADAV_DONE)
  #define LOADAV_DONE
  /*
   * This is the easy way. It relies in /proc being mounted.
*** misc.c.orig	Thu Jul 29 10:08:56 1999
--- misc.c	Thu May 11 12:55:07 2000
***************
*** 633,639 ****
     */
  # endif /* NEEDSETENV */
  #else /* USESETENV */
! # if defined(linux) || defined(__convex__) || (BSD >= 199103)
    setenv(var, value, 0);
  # else
    setenv(var, value);
--- 633,639 ----
     */
  # endif /* NEEDSETENV */
  #else /* USESETENV */
! # if defined(__CYGWIN__) || defined(linux) || defined(__convex__) || (BSD >= 199103)
    setenv(var, value, 0);
  # else
    setenv(var, value);
***************
*** 816,822 ****
    return 0;
  }
  
! # ifdef linux
  
  /* stupid stupid linux ncurses! It won't to padding with
   * zeros but sleeps instead. This breaks CalcCost, of course.
--- 816,822 ----
    return 0;
  }
  
! # if defined(linux) || defined(__CYGWIN__)
  
  /* stupid stupid linux ncurses! It won't to padding with
   * zeros but sleeps instead. This breaks CalcCost, of course.
*** os.h.orig	Mon Jul 19 17:41:43 1999
--- os.h	Thu May 11 12:55:08 2000
***************
*** 67,73 ****
  # undef exit
  #endif /* sun */
  
! #ifndef linux /* all done in <errno.h> */
  extern int errno;
  #endif /* linux */
  #ifndef HAVE_STRERROR
--- 67,73 ----
  # undef exit
  #endif /* sun */
  
! #if !defined(__CYGWIN__) && !defined(linux) /* all done in <errno.h> */
  extern int errno;
  #endif /* linux */
  #ifndef HAVE_STRERROR
***************
*** 240,246 ****
  #endif
  
  /* linux ncurses is broken, we have to use our own tputs */
! #if defined(linux) && defined(TERMINFO)
  # define tputs xtputs
  #endif
  
--- 240,246 ----
  #endif
  
  /* linux ncurses is broken, we have to use our own tputs */
! #if (defined(__CYGWIN__) || defined(linux)) && defined(TERMINFO)
  # define tputs xtputs
  #endif
  
***************
*** 407,413 ****
  #endif
  
  /* Geeeee, reverse it? */
! #if defined(SVR4) || (defined(SYSV) && defined(ISC)) || defined(_AIX) || defined(linux) || defined(ultrix) || defined(__386BSD__) || defined(__bsdi__) || defined(POSIX) || defined(NeXT)
  # define SIGHASARG
  #endif
  
--- 407,413 ----
  #endif
  
  /* Geeeee, reverse it? */
! #if defined(SVR4) || (defined(SYSV) && defined(ISC)) || defined(_AIX) || defined(linux) || defined(ultrix) || defined(__386BSD__) || defined(__bsdi__) || defined(POSIX) || defined(NeXT) || defined(__CYGWIN__)
  # define SIGHASARG
  #endif
  
*** osdef.sh.orig	Tue Apr 21 19:43:07 1998
--- osdef.sh	Thu May 11 12:55:08 2000
***************
*** 24,30 ****
  #ifndef sun
  #include <sys/ioctl.h>
  #endif
! #ifdef linux
  #include <string.h>
  #include <stdlib.h>
  #endif
--- 24,30 ----
  #ifndef sun
  #include <sys/ioctl.h>
  #endif
! #if defined(linux) || defined(__CYGWIN__)
  #include <string.h>
  #include <stdlib.h>
  #endif
*** pty.c.orig	Mon Jul 19 17:46:31 1999
--- pty.c	Thu May 11 12:55:08 2000
***************
*** 38,44 ****
--- 38,46 ----
  
  /* for solaris 2.1, Unixware (SVR4.2) and possibly others */
  #ifdef HAVE_SVR4_PTYS
+ #ifndef __CYGWIN__
  # include <sys/stropts.h>
+ #endif	/* no Cygwin */
  #endif
  
  #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)
*** screen.c.orig	Wed Aug 11 20:13:43 1999
--- screen.c	Thu May 11 12:55:08 2000
***************
*** 306,312 ****
  #endif
    if (n < 13)
      ppp->pw_passwd = 0;
! #ifdef linux
    if (ppp->pw_passwd && strlen(ppp->pw_passwd) == 13 + 11)
      ppp->pw_passwd[13] = 0;	/* beware of linux's long passwords */
  #endif
--- 306,312 ----
  #endif
    if (n < 13)
      ppp->pw_passwd = 0;
! #if defined(linux) || defined(__CYGWIN__)
    if (ppp->pw_passwd && strlen(ppp->pw_passwd) == 13 + 11)
      ppp->pw_passwd[13] = 0;	/* beware of linux's long passwords */
  #endif
***************
*** 920,927 ****
--- 920,929 ----
  	      n = (eff_uid == 0 && (real_uid || (st.st_mode & 0777) != 0777)) ? 0755 :
  	          (eff_gid == st.st_gid && eff_gid != real_gid) ? 0775 :
  		  0777;
+ #ifndef __CYGWIN__
  	      if ((st.st_mode & 0777) != n)
  		Panic(0, "Directory '%s' must have mode %03o.", SockDir, n);
+ #endif	/* no Cygwin */
  	    }
  	  sprintf(SockPath, "%s/S-%s", SockDir, LoginName);
  	  if (access(SockPath, F_OK))
***************
*** 951,958 ****
--- 953,962 ----
        if (st.st_uid != real_uid)
  	Panic(0, "You are not the owner of %s.", SockPath);
      }
+ #ifndef __CYGWIN__
    if ((st.st_mode & 0777) != 0700)
      Panic(0, "Directory %s must have mode 700.", SockPath);
+ #endif	/* no Cygwin */
    SockName = SockPath + strlen(SockPath) + 1;
    *SockName = 0;
    (void) umask(oumask);
*** utmp.c.orig	Thu Aug 05 09:26:07 1999
--- utmp.c	Thu May 11 12:55:08 2000
***************
*** 38,44 ****
  extern char *LoginName;
  extern int real_uid, eff_uid;
  
- 
  /*
   *  UTNOKEEP: A (ugly) hack for apollo that does two things:
   *    1) Always close and reopen the utmp file descriptor. (I don't know
--- 38,43 ----
***************
*** 85,91 ****
  static int  initutmp __P((void));
  static void setutent __P((void));
  #endif
! #if defined(linux) && defined(GETUTENT)
  static struct utmp *xpututline __P((struct utmp *utmp));
  # define pututline xpututline
  #endif
--- 84,90 ----
  static int  initutmp __P((void));
  static void setutent __P((void));
  #endif
! #if (defined(__CYGWIN__) || defined(linux)) && defined(GETUTENT)
  static struct utmp *xpututline __P((struct utmp *utmp));
  # define pututline xpututline
  #endif
***************
*** 583,590 ****
--- 582,591 ----
  struct utmp *u;
  {
    u->ut_type = DEAD_PROCESS;
+ #ifndef __CYGWIN__
    u->ut_exit.e_termination = 0;
    u->ut_exit.e_exit = 0;
+ #endif
  #if !defined(sun) || !defined(SVR4)
    u->ut_user[0] = 0;	/* for Digital UNIX, kilbi@rad.rwth-aachen.de */
  #endif
***************
*** 599,605 ****
    u->ut_type = USER_PROCESS;
    strncpy(u->ut_user, user, sizeof(u->ut_user));
    /* Now the tricky part... guess ut_id */
! #if defined(sgi) || defined(linux)
    strncpy(u->ut_id, line + 3, sizeof(u->ut_id));
  #else /* sgi */
  # ifdef _IBMR2
--- 600,606 ----
    u->ut_type = USER_PROCESS;
    strncpy(u->ut_user, user, sizeof(u->ut_user));
    /* Now the tricky part... guess ut_id */
! #if defined(sgi) || defined(linux) || defined(__CYGWIN__)
    strncpy(u->ut_id, line + 3, sizeof(u->ut_id));
  #else /* sgi */
  # ifdef _IBMR2
***************
*** 850,856 ****
  }
  # endif /* BUGGYGETLOGIN */
  
! #if defined(linux) && defined(GETUTENT)
  # undef pututline
  
  /* aargh, linux' pututline returns void! */
--- 851,857 ----
  }
  # endif /* BUGGYGETLOGIN */
  
! #if (defined(__CYGWIN__) || defined(linux)) && defined(GETUTENT)
  # undef pututline
  
  /* aargh, linux' pututline returns void! */
*** window.c.orig	Thu Aug 05 17:43:14 1999
--- window.c	Thu May 11 12:55:08 2000
***************
*** 987,993 ****
      }
    debug1("fcntl(%d, F_SETFL, FNBLOCK)\n", f);
    (void) fcntl(f, F_SETFL, FNBLOCK);
! #ifdef linux
    /*
     * Tenebreux (zeus@ns.acadiacom.net) has Linux 1.3.70 where select
     * gets confused in the following condition:
--- 987,993 ----
      }
    debug1("fcntl(%d, F_SETFL, FNBLOCK)\n", f);
    (void) fcntl(f, F_SETFL, FNBLOCK);
! #if defined(__CYGWIN__) || defined(linux)
    /*
     * Tenebreux (zeus@ns.acadiacom.net) has Linux 1.3.70 where select
     * gets confused in the following condition:
