From: Fifer, Eric Date: Fri, 30 Jul 1999 18:31:48 +0000 (+0100) Subject: cygwin update X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6dce6b70b85ef184fc8b4432d2436d1be5f0b117;p=p5sagit%2Fp5-mst-13.2.git cygwin update Message-Id: <71E287AB0D94D111BBD600600849EC8185EE06@POST> Subject: [ID 19990730.003] PATCH] perl5.005_58 cygwin port p4raw-id: //depot/perl@3855 --- diff --git a/doio.c b/doio.c index 32c3a04..8162e53 100644 --- a/doio.c +++ b/doio.c @@ -548,7 +548,7 @@ Perl_nextargv(pTHX_ register GV *gv) } #endif #ifdef HAS_RENAME -#ifndef DOSISH +#if !defined(DOSISH) && !defined(CYGWIN) if (PerlLIO_rename(PL_oldname,SvPVX(sv)) < 0) { if (ckWARN_d(WARN_INPLACE)) Perl_warner(aTHX_ WARN_INPLACE, diff --git a/dosish.h b/dosish.h index c936250..822182d 100644 --- a/dosish.h +++ b/dosish.h @@ -23,7 +23,7 @@ # define PERL_SYS_INIT(c,v) Perl_win32_init(c,v) # define BIT_BUCKET "nul" # else -# define PERL_SYS_INIT(c,v) Perl_my_setenv_init(&environ) +# define PERL_SYS_INIT(c,v) # define BIT_BUCKET "\\dev\\nul" /* "wanna be like, umm, Newlined, or somethin?" */ # endif #endif /* DJGPP */ diff --git a/lib/File/Spec/Unix.pm b/lib/File/Spec/Unix.pm index e33ecb7..87ad643 100644 --- a/lib/File/Spec/Unix.pm +++ b/lib/File/Spec/Unix.pm @@ -41,7 +41,7 @@ ricochet (some scripts depend on it). sub canonpath { my ($self,$path,$reduce_ricochet) = @_; - $path =~ s|/+|/|g; # xx////xx -> xx/xx + $path =~ s|/+|/|g unless($^O =~ /cygwin/); # xx////xx -> xx/xx $path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx $path =~ s|^(\./)+|| unless $path eq "./"; # ./xx -> xx $path =~ s|^/(\.\./)+|/|; # /../../xx -> xx diff --git a/mg.c b/mg.c index 695272d..e10f0c3 100644 --- a/mg.c +++ b/mg.c @@ -828,7 +828,12 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg) } FreeEnvironmentStrings(envv); # else -# ifndef PERL_USE_SAFE_PUTENV +# ifdef CYGWIN + I32 i; + for (i = 0; environ[i]; i++) + Safefree(environ[i]); +# else +# ifndef PERL_USE_SAFE_PUTENV I32 i; if (environ == PL_origenviron) @@ -836,7 +841,8 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg) else for (i = 0; environ[i]; i++) safesysfree(environ[i]); -# endif /* PERL_USE_SAFE_PUTENV */ +# endif /* PERL_USE_SAFE_PUTENV */ +# endif /* CYGWIN */ environ[0] = Nullch; diff --git a/perl.h b/perl.h index 8ff2199..a8cee21 100644 --- a/perl.h +++ b/perl.h @@ -1653,7 +1653,7 @@ typedef pthread_key_t perl_key; */ # define USEMYBINMODE / **/ # define my_binmode(fp, iotype) \ - (PerlLIO_setmode(PerlIO_fileno(fp), O_BINARY) != -1 ? TRUE : NULL) + (PerlLIO_setmode(PerlIO_fileno(fp), O_BINARY) != -1 ? TRUE : FALSE) #endif #ifdef UNION_ANY_DEFINITION diff --git a/perlsdio.h b/perlsdio.h index efc52e1..46a15de 100644 --- a/perlsdio.h +++ b/perlsdio.h @@ -79,7 +79,11 @@ #ifdef HAS_SETLINEBUF #define PerlIO_setlinebuf(f) setlinebuf(f); #else -#define PerlIO_setlinebuf(f) setvbuf(f, Nullch, _IOLBF, 0); +# ifdef CYGWIN +# define PerlIO_setlinebuf(f) +# else +# define PerlIO_setlinebuf(f) setvbuf(f, Nullch, _IOLBF, 0); +# endif #endif /* Now our interface to Configure's FILE_xxx macros */ diff --git a/pp_sys.c b/pp_sys.c index 76a5210..b63101d 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -3543,7 +3543,7 @@ PP(pp_fork) PP(pp_wait) { -#if !defined(DOSISH) || defined(OS2) || defined(WIN32) || defined(CYGWIN) +#if !defined(DOSISH) || defined(OS2) || defined(WIN32) djSP; dTARGET; Pid_t childpid; int argflags; @@ -3559,7 +3559,7 @@ PP(pp_wait) PP(pp_waitpid) { -#if !defined(DOSISH) || defined(OS2) || defined(WIN32) || defined(CYGWIN) +#if !defined(DOSISH) || defined(OS2) || defined(WIN32) djSP; dTARGET; Pid_t childpid; int optype; diff --git a/unixish.h b/unixish.h index eab2de1..2d37fbe 100644 --- a/unixish.h +++ b/unixish.h @@ -122,7 +122,11 @@ # ifdef POSIX_BC # define PERL_SYS_INIT(c,v) sigignore(SIGFPE); MALLOC_INIT # else -# define PERL_SYS_INIT(c,v) MALLOC_INIT +# 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 # endif #endif #endif diff --git a/util.c b/util.c index 87ebb55..f9d0559 100644 --- a/util.c +++ b/util.c @@ -2547,7 +2547,7 @@ Perl_my_pclose(pTHX_ PerlIO *ptr) } #endif /* !DOSISH */ -#if !defined(DOSISH) || defined(OS2) || defined(WIN32) || defined(CYGWIN) +#if !defined(DOSISH) || defined(OS2) || defined(WIN32) I32 Perl_wait4pid(pTHX_ int pid, int *statusp, int flags) {