From: Fifer, Eric Date: Tue, 7 Nov 2000 18:08:51 +0000 (+0000) Subject: cygwin port X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=47dafe4d9a4e294fab4b6131bb296dc386e0dcbc;p=p5sagit%2Fp5-mst-13.2.git cygwin port Message-ID: <779F20BCCE5AD31186A50008C75D99791717BB@silldn_mail1.sanwaint.com> Synchronize with Cygwin 1.1.5. p4raw-id: //depot/perl@7597 --- diff --git a/AUTHORS b/AUTHORS index dbc47bb..1b80418 100644 --- a/AUTHORS +++ b/AUTHORS @@ -136,7 +136,7 @@ Elaine -HFB- Ashton Eric Arnold Eric Bartley Eric E. Coe -Eric Fifer +Eric Fifer Erich Rickheit Eryq Eugene Alterman diff --git a/README.cygwin b/README.cygwin index 9718bb5..7e6a342 100644 --- a/README.cygwin +++ b/README.cygwin @@ -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 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 , -Eric Fifer , +Eric Fifer , alexander smishlajev , Steven Morlock , Sebastien Barre , @@ -596,4 +593,4 @@ Teun Burgers . =head1 HISTORY -Last updated: 15 August 2000 +Last updated: 7 November 2000 diff --git a/cygwin/cygwin.c b/cygwin/cygwin.c index db1c426..33ea4db 100644 --- a/cygwin/cygwin.c +++ b/cygwin/cygwin.c @@ -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); diff --git a/hints/cygwin.sh b/hints/cygwin.sh index 7be1735..c57d3f6 100644 --- a/hints/cygwin.sh +++ b/hints/cygwin.sh @@ -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 --- 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; diff --git a/pod/perlport.pod b/pod/perlport.pod index 76b22c6..1078e58 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -686,7 +686,7 @@ The ActiveState Pages, http://www.activestate.com/ =item * The Cygwin environment for Win32; F (installed -as L), http://sources.redhat.com/cygwin/ +as L), http://www.cygwin.com/ =item * diff --git a/unixish.h b/unixish.h index 5815a19..f6923b7 100644 --- a/unixish.h +++ b/unixish.h @@ -129,11 +129,7 @@ # 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 --- 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)