summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doio.c2
-rw-r--r--dosish.h2
-rw-r--r--lib/File/Spec/Unix.pm2
-rw-r--r--mg.c10
-rw-r--r--perl.h2
-rw-r--r--perlsdio.h6
-rw-r--r--pp_sys.c4
-rw-r--r--unixish.h6
-rw-r--r--util.c2
9 files changed, 25 insertions, 11 deletions
diff --git a/doio.c b/doio.c
index 32c3a04165..8162e53aba 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 c936250075..822182dedf 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 e33ecb7b36..87ad643fe2 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 695272dc9f..e10f0c3869 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 8ff2199b05..a8cee21a77 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 efc52e1cd4..46a15de9fa 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 76a521039d..b63101d6d8 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 eab2de1643..2d37fbe166 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 87ebb55bff..f9d0559d24 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)
{