diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-08-26 20:34:48 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-08-26 20:34:48 +0000 |
commit | 7da0e3835572d02b95a50131e2eb75d6ecad02e5 (patch) | |
tree | b40c8c5a44b053ae222e0ec63e304cc82e5fabd7 | |
parent | d34c2299ce15c4bc317af0031fa77cc4a77ec346 (diff) | |
download | perl-7da0e3835572d02b95a50131e2eb75d6ecad02e5.tar.gz |
Integrate two DJGPP portability patches from the 5.6.2 branch :
[20859]
Two portability patches for DJGPP from Richard Dawe
<rich@phekda.freeserve.co.uk>.
Message-Id: <E19qfNh-0000Zq-00@phekda.freeserve.co.uk>
[20911]
Don't uppercase automatically all environment variables on DJGPP.
(reported by Richard Dawe, this breaks portability of Unix
scripts.) Don't change the behaviour on plain MS/DOS.
p4raw-link: @20911 on //depot/maint-5.6/perl-5.6.2: 91a64263ab3d9ea51fa198428b79b128d13386a5
p4raw-link: @20859 on //depot/maint-5.6/perl-5.6.2: e61553d05d06f2b080893dabff3b9134ba8b77f7
p4raw-id: //depot/perl@20913
p4raw-edited: from //depot/maint-5.6/perl-5.6.2@20912 'edit in' perl.c
(@20322..)
p4raw-integrated: from //depot/maint-5.6/perl-5.6.2@20912 'merge in'
djgpp/djgppsed.sh dosish.h (@20322..)
-rw-r--r-- | djgpp/djgppsed.sh | 2 | ||||
-rw-r--r-- | dosish.h | 45 | ||||
-rw-r--r-- | perl.c | 2 |
3 files changed, 47 insertions, 2 deletions
diff --git a/djgpp/djgppsed.sh b/djgpp/djgppsed.sh index 8ce64a4a75..f84452e636 100644 --- a/djgpp/djgppsed.sh +++ b/djgpp/djgppsed.sh @@ -39,7 +39,7 @@ sed -e $SABC t/io/inplace.t >s; mv -f s t/io/inplace.t sed -e $SDBMX -e $SDBHASH ext/GDBM_File/t/gdbm.t >s; mv -f s ext/GDBM_File/t/gdbm.t sed -e $SSTAT -e $STMP2 t/op/stat.t >s; mv -f s t/op/stat.t sed -e $SLIST x2p/Makefile.SH |tr -d '\r' >s; mv -f s x2p/Makefile.SH -sed -e 's=^#define.\([A-Z]\+\)_EXP.*$=#define \1_EXP djgpp_pathexp("\1")=g' config_h.SH >s; mv -f s config_h.SH +#sed -e 's=^#define.\([A-Z]\+\)_EXP.*$=#define \1_EXP djgpp_pathexp("\1")=g' config_h.SH >s; mv -f s config_h.SH sed -e 's=:^/:={^([a-z]:)?[\\\\/]}=g' lib/termcap.pl >s; mv -f s lib/termcap.pl sed -e $SPACKLIST installman >s; mv -f s installman sed -e $SPACKLIST lib/ExtUtils/Installed.pm >s; mv -f s lib/ExtUtils/Installed.pm @@ -139,3 +139,48 @@ # define HAS_WAIT # define HAS_CHOWN #endif /* WIN32 */ + +/* + * <rich@phekda.freeserve.co.uk>: The DJGPP port has code that converts + * the return code of system() into the form that Unixy wait usually + * returns: + * + * - signal number in bits 0-6; + * - core dump flag in bit 7; + * - exit code in bits 8-15. + * + * Bits 0-7 are always zero for DJGPP, because it uses system(). + * See djgpp.c. + * + * POSIX::W* use the W* macros from <sys/wait.h> to decode + * the return code. Unfortunately the W* macros for DJGPP use + * a different format than Unixy wait does. So there's a mismatch + * and, say, WEXITSTATUS($?) will return bogus values. + * + * So here we add hack to redefine the W* macros from DJGPP's <sys/wait.h> + * to work with our return-code conversion. + */ + +#ifdef DJGPP + +#include <sys/wait.h> + +#undef WEXITSTATUS +#undef WIFEXITED +#undef WIFSIGNALED +#undef WIFSTOPPED +#undef WNOHANG +#undef WSTOPSIG +#undef WTERMSIG +#undef WUNTRACED + +#define WEXITSTATUS(stat_val) ((stat_val) >> 8) +#define WIFEXITED(stat_val) 0 +#define WIFSIGNALED(stat_val) 0 +#define WIFSTOPPED(stat_val) 0 +#define WNOHANG 0 +#define WSTOPSIG(stat_val) 0 +#define WTERMSIG(stat_val) 0 +#define WUNTRACED 0 + +#endif @@ -3759,7 +3759,7 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register for (; *env; env++) { if (!(s = strchr(*env,'='))) continue; -#if defined(MSDOS) +#if defined(MSDOS) && !defined(DJGPP) *s = '\0'; (void)strupr(*env); *s = '='; |