This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
cygwin port
authorFifer, Eric <EFifer@sanwaint.com>
Tue, 7 Nov 2000 18:08:51 +0000 (18:08 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 7 Nov 2000 21:43:29 +0000 (21:43 +0000)
Message-ID: <779F20BCCE5AD31186A50008C75D99791717BB@silldn_mail1.sanwaint.com>

Synchronize with Cygwin 1.1.5.

p4raw-id: //depot/perl@7597

AUTHORS
README.cygwin
cygwin/cygwin.c
hints/cygwin.sh
mg.c
pod/perlport.pod
unixish.h
util.c

diff --git a/AUTHORS b/AUTHORS
index dbc47bb..1b80418 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -136,7 +136,7 @@ Elaine -HFB- Ashton            <elaine@chaos.wustl.edu>
 Eric Arnold                    <eric.arnold@sun.com>
 Eric Bartley                   <bartley@icd.cc.purdue.edu>
 Eric E. Coe                    <Eric.Coe@oracle.com>
-Eric Fifer                     <EFifer@sanwaint.com>
+Eric Fifer                     <egf7@columbia.edu>
 Erich Rickheit
 Eryq                           <eryq@zeegee.com>
 Eugene Alterman                <Eugene.Alterman@bremer-inc.com>
index 9718bb5..7e6a342 100644 (file)
@@ -27,11 +27,11 @@ platforms.  They run thanks to the Cygwin library which provides the UNIX
 system calls and environment these programs expect.  More information
 about this project can be found at:
 
-  http://sources.redhat.com/cygwin/
+  http://www.cygwin.com/
 
 A recent net or commercial release of Cygwin is required.
 
-At the time this document was last updated, Cygwin 1.1.4 was current.
+At the time this document was last updated, Cygwin 1.1.5 was current.
 
 B<NOTE:> At this point, minimal effort has been made to provide
 compatibility with old (beta) Cygwin releases.  The focus has been to
@@ -500,12 +500,11 @@ be kept as clean as possible.
 
 =item Documentation
 
-  INSTALL README.cygwin
+  INSTALL README.cygwin README.win32 MANIFEST
   Changes Changes5.005 Changes5.004 Changes5.6
-  AUTHORS MAINTAIN MANIFEST README.win32
-  pod/buildtoc.PL pod/perl.pod pod/perl5004delta.pod pod/perl56delta.pod
-  pod/perlfaq3.pod pod/perlhist.pod pod/perlmodlib.pod pod/perlport.pod
-  pod/perltoc.pod
+  pod/perl.pod pod/perlport.pod pod/perlfaq3.pod
+  pod/perldelta.pod pod/perl5004delta.pod pod/perl56delta.pod
+  pod/perlhist.pod pod/perlmodlib.pod pod/buildtoc.PL pod/perltoc.pod
 
 =item Build, Configure, Make, Install
 
@@ -543,9 +542,7 @@ be kept as clean as possible.
   perl.h                - binmode
   doio.c                - win9x can not rename a file when it is open
   pp_sys.c              - do not define h_errno, pp_system with spawn
-  mg.c                  - environ WORKAROUND
-  unixish.h             - environ WORKAROUND
-  util.c                - environ WORKAROUND
+  util.c                - use setenv
 
 =item Compiled Module Source
 
@@ -588,7 +585,7 @@ and security contexts are required.
 =head1 AUTHORS
 
 Charles Wilson <cwilson@ece.gatech.edu>,
-Eric Fifer <efifer@sanwaint.com>,
+Eric Fifer <egf7@columbia.edu>,
 alexander smishlajev <als@turnhere.com>,
 Steven Morlock <newspost@morlock.net>,
 Sebastien Barre <Sebastien.Barre@utc.fr>,
@@ -596,4 +593,4 @@ Teun Burgers <burgers@ecn.nl>.
 
 =head1 HISTORY
 
-Last updated: 15 August 2000
+Last updated: 7 November 2000
index db1c426..33ea4db 100644 (file)
@@ -146,7 +146,7 @@ XS(Cygwin_cwd)
 
     if(items != 0)
        Perl_croak(aTHX_ "Usage: Cwd::cwd()");
-    if((cwd = getcwd(NULL, 0))) {
+    if((cwd = getcwd(NULL, -1))) {
        ST(0) = sv_2mortal(newSVpv(cwd, 0));
        safesysfree(cwd);
        XSRETURN(1);
index 7be1735..c57d3f6 100644 (file)
@@ -25,6 +25,7 @@ libswanted=`echo " $libswanted " | sed -e 's/ c / /g'`
 libswanted=`echo " $libswanted " | sed -e 's/ m / /g'`
 libswanted="$libswanted cygipc"
 test -z "$optimize" && optimize='-O2'
+ccflags="$ccflags -DPERL_USE_SAFE_PUTENV"
 # - otherwise i686-cygwin
 archname='cygwin'
 
diff --git a/mg.c b/mg.c
index bec0a82..923915d 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -936,11 +936,6 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg)
            cur += len+1;
     }
     FreeEnvironmentStrings(envv);
-#   else
-#      ifdef __CYGWIN__
-    I32 i;
-    for (i = 0; environ[i]; i++)
-       safesysfree(environ[i]);
 #      else
 #          ifndef PERL_USE_SAFE_PUTENV
     I32 i;
@@ -951,7 +946,6 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg)
        for (i = 0; environ[i]; i++)
            safesysfree(environ[i]);
 #          endif /* PERL_USE_SAFE_PUTENV */
-#      endif /* __CYGWIN__ */
 
     environ[0] = Nullch;
 
index 76b22c6..1078e58 100644 (file)
@@ -686,7 +686,7 @@ The ActiveState Pages, http://www.activestate.com/
 =item *
 
 The Cygwin environment for Win32; F<README.cygwin> (installed 
-as L<perlcygwin>), http://sources.redhat.com/cygwin/
+as L<perlcygwin>), http://www.cygwin.com/
 
 =item *
 
index 5815a19..f6923b7 100644 (file)
--- a/unixish.h
+++ b/unixish.h
 #  ifdef POSIX_BC
 #    define PERL_SYS_INIT(c,v) sigignore(SIGFPE); MALLOC_INIT
 #  else
-#    ifdef __CYGWIN__
-#      define PERL_SYS_INIT(c,v) Perl_my_setenv_init(&environ); MALLOC_INIT
-#    else
-#      define PERL_SYS_INIT(c,v) MALLOC_INIT
-#    endif
+#    define PERL_SYS_INIT(c,v) MALLOC_INIT
 #  endif
 #endif
 #endif
diff --git a/util.c b/util.c
index 34cdaaf..0cb5c30 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1981,7 +1981,7 @@ Perl_vwarner(pTHX_ U32  err, const char* pat, va_list* args)
 
 #ifdef USE_ENVIRON_ARRAY
        /* VMS' and EPOC's my_setenv() is in vms.c and epoc.c */
-#if !defined(WIN32) && !defined(__CYGWIN__)
+#if !defined(WIN32)
 void
 Perl_my_setenv(pTHX_ char *nam, char *val)
 {
@@ -2023,50 +2023,19 @@ Perl_my_setenv(pTHX_ char *nam, char *val)
     (void)sprintf(environ[i],"%s=%s",nam,val);/* all that work just for this */
 
 #else   /* PERL_USE_SAFE_PUTENV */
+#   if defined(__CYGWIN__)
+    setenv(nam, val, 1);
+#   else
     char *new_env;
 
     new_env = (char*)safesysmalloc((strlen(nam) + strlen(val) + 2) * sizeof(char));
     (void)sprintf(new_env,"%s=%s",nam,val);/* all that work just for this */
     (void)putenv(new_env);
+#   endif /* __CYGWIN__ */
 #endif  /* PERL_USE_SAFE_PUTENV */
 }
 
-#else /* WIN32 || __CYGWIN__ */
-#if defined(__CYGWIN__)
-/*
- * Save environ of perl.exe, currently Cygwin links in separate environ's
- * for each exe/dll.  Probably should be a member of impure_ptr.
- */
-static char ***Perl_main_environ;
-
-EXTERN_C void
-Perl_my_setenv_init(char ***penviron)
-{
-    Perl_main_environ = penviron;
-}
-
-void
-Perl_my_setenv(pTHX_ char *nam, char *val)
-{
-    /* You can not directly manipulate the environ[] array because
-     * the routines do some additional work that syncs the Cygwin
-     * environment with the Windows environment.
-     */
-    char *oldstr = environ[setenv_getix(nam)];
-
-    if (!val) {
-       if (!oldstr)
-           return;
-       unsetenv(nam);
-       safesysfree(oldstr);
-       return;
-    }
-    setenv(nam, val, 1);
-    environ = *Perl_main_environ; /* environ realloc can occur in setenv */
-    if(oldstr && environ[setenv_getix(nam)] != oldstr)
-       safesysfree(oldstr);
-}
-#else /* if WIN32 */
+#else /* WIN32 */
 
 void
 Perl_my_setenv(pTHX_ char *nam,char *val)
@@ -2127,7 +2096,6 @@ Perl_my_setenv(pTHX_ char *nam,char *val)
 }
 
 #endif /* WIN32 */
-#endif
 
 I32
 Perl_setenv_getix(pTHX_ char *nam)