This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 17 Sep 2003 11:35:38 +0000 (11:35 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 17 Sep 2003 11:35:38 +0000 (11:35 +0000)
[ 21253]
Subject: [DOC PATCH] Re: [perl #23779] $? and negative exit codes
From: Dave Mitchell <davem@fdgroup.com>
Date: Tue, 16 Sep 2003 21:56:20 +0100
Message-ID: <20030916205620.GB1246@fdgroup.com>

[ 21257]
Subject: [PATCH 5.8.1 @21211] magic.t
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Date: Tue, 16 Sep 2003 19:17:57 -0700
Message-ID: <20030917021757.GA20261@math.berkeley.edu>

[ 21258]
Subject: [PATCH 5.8.1 @21211] os2_process.t
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Date: Tue, 16 Sep 2003 23:21:48 -0700
Message-ID: <20030917062147.GA20400@math.berkeley.edu>

[ 21259]
Subject: [PATCH 5.8.1 @21211] OS/2 APIs again
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Date: Tue, 16 Sep 2003 23:49:42 -0700
Message-ID: <20030917064941.GA20444@math.berkeley.edu>

[ 21260]
Fix Solaris ccversion not having the cc version.

[ 21261]
The AIX C product potentially consists of several packages,
the main package being (hopefully) the first one.
p4raw-link: @21261 on //depot/perl: 35727b84c71fa1997973466e1085cc7718896a75
p4raw-link: @21260 on //depot/perl: 68fed2afeea75342559d1bce2d459572bbdd23e4
p4raw-link: @21259 on //depot/perl: 4ab57fcbe55563102f75ccfb800b14bb33d79457
p4raw-link: @21258 on //depot/perl: be4925cb01e0e3f28046e3417d8e84ca65859589
p4raw-link: @21257 on //depot/perl: 639cf43be4808c24d6c8660c3a09bcb92311abbf
p4raw-link: @21253 on //depot/perl: 4ef107a6cabd33854b770659cca90f12a2326104

p4raw-id: //depot/maint-5.8/perl@21262
p4raw-integrated: from //depot/perl@21251 'copy in'
os2/OS2/Process/t/os2_process.t (@18314..) hints/solaris_2.sh
(@19897..) hints/aix.sh (@21163..) 'merge in' os2/os2ish.h
(@20454..) t/op/magic.t (@20872..) pod/perlfunc.pod (@21198..)

hints/aix.sh
hints/solaris_2.sh
os2/OS2/Process/t/os2_process.t
os2/os2ish.h
pod/perlfunc.pod
t/op/magic.t

index bf1667b..dd800ae 100644 (file)
@@ -145,7 +145,7 @@ case "$cc" in
      gccversion=`$cc --version | sed 's/.*(GCC) *//'`
      fi
    ;;
-*) ccversion=`lslpp -L | grep 'C for AIX Compiler$' | grep -v '\.msg\.[A-Za-z_]*\.' | awk '{print $1,$2}'`
+*) ccversion=`lslpp -L | grep 'C for AIX Compiler$' | grep -v '\.msg\.[A-Za-z_]*\.' | head -1 | awk '{print $1,$2}'`
    case "$ccversion" in
      '') ccversion=`lslpp -L | grep 'IBM C and C++ Compilers LUM$'`
         ;;
index 5d643de..c54148b 100644 (file)
@@ -210,7 +210,7 @@ if echo "$verbose" | grep '^Reading specs from' >/dev/null 2>&1; then
        #
        # Using gcc.
        #
-       ccversion='gcc'
+       cc_name='gcc'
 
        # See if as(1) is GNU as(1).  GNU as(1) might not work for this job.
        if echo "$verbose" | grep ' /usr/ccs/bin/as ' >/dev/null 2>&1; then
@@ -294,9 +294,12 @@ return(0);
 EOM
        tryworkshopcc="${cc:-cc} try.c -o try"
        if $tryworkshopcc >/dev/null 2>&1; then
-               ccversion=`./try`
-               if test "$ccversion" = "workshop" -a ! "$use64bitall_done"; then
-                       loclibpth="/usr/lib /usr/ccs/lib `$getworkshoplibs` $loclibpth"
+               cc_name=`./try`
+               if test "$cc_name" = "workshop"; then
+                       ccversion="`${cc:-cc} -V 2>&1|sed -n -e '1s/^cc: //p'`"
+                       if test ! "$use64bitall_done"; then
+                               loclibpth="/usr/lib /usr/ccs/lib `$getworkshoplibs` $loclibpth"
+                       fi
                fi
        fi
 
@@ -567,7 +570,7 @@ cat > UU/uselongdouble.cbu <<'EOCBU'
 # after it has prompted the user for whether to use long doubles.
 case "$uselongdouble" in
 "$define"|true|[yY]*)
-       if test "$ccversion" = "workshop"; then
+       if test "$cc_name" = "workshop"; then
                cat > try.c << 'EOM'
 #include <sunmath.h>
 int main() { (void) powl(2, 256); return(0); }
index 016c799..123525d 100644 (file)
@@ -24,7 +24,7 @@ BEGIN {                       # Remap I/O to the parent's window
 }
 
 use strict;
-use Test::More tests => 230;
+use Test::More tests => 232;
 use OS2::Process;
 
 sub SWP_flags ($) {
@@ -407,9 +407,14 @@ ok $my_pos, 'got my position';
   ok IsWindowShowing $k_hwnd, 'kid is showing';
   ok IsWindowVisible $k_hwnd, 'kid is flaged as visible';
   ok IsWindowEnabled $k_hwnd, 'kid is flaged as enabled';
+  SKIP: {
+    skip 'if defaultVIO=MAXIMIZED, new windows are shifted, but maximize to UL corner', 1 unless $fl & 0x800;
+    ok hWindowPos_set({x => $ppos[0], y => $ppos[1]}, $k_hwnd), 'x,y-restore for de-minimization of MAXIMIZED';
+  }
   @nkpos = WindowPos $k_hwnd;
   is_deeply([@ppos[0..5]], [@nkpos[0..5]], 'position restored');
 
+
   # Now the other way
   ok hWindowPos_set( {flags => 0x400}, $k_hwnd), 'set to minimized';
   ok !IsWindowShowing $k_hwnd, 'kid is not showing';
@@ -452,6 +457,10 @@ ok $my_pos, 'got my position';
   ok IsWindowShowing $k_hwnd, 'kid is showing';
   ok IsWindowVisible $k_hwnd, 'kid is flaged as visible';
   ok IsWindowEnabled $k_hwnd, 'kid is flaged as enabled';
+  SKIP: {
+    skip 'if defaultVIO=MAXIMIZED, new windows are shifted, but maximize to UL corner', 1 unless $fl & 0x800;
+    ok hWindowPos_set({x => $ppos[0], y => $ppos[1]}, $k_hwnd), 'x,y-restore for de-minimization of MAXIMIZED';
+  }
   @nkpos = WindowPos $k_hwnd;
   is_deeply([@ppos[0..5]], [@nkpos[0..5]], 'position restored');
 
index 1f162a8..7d4c84c 100644 (file)
@@ -532,7 +532,7 @@ void init_PMWIN_entries(void);
 
 /* The expressions below return true on error. */
 /* INCL_DOSERRORS needed. rc should be declared outside. */
-#define CheckOSError(expr) (!(rc = (expr)) ? 0 : (FillOSError(rc), 1))
+#define CheckOSError(expr) ((rc = (expr)) ? (FillOSError(rc), rc) : 0)
 /* INCL_WINERRORS needed. */
 #define CheckWinError(expr) ((expr) ? 0: (FillWinError, 1))
 
@@ -681,6 +681,7 @@ enum entries_ordinals {
     ORD_WinFlashWindow,
     ORD_WinLoadPointer,
     ORD_WinQuerySysPointer,
+    ORD_DosReplaceModule,
     ORD_NENTRIES
 };
 
@@ -691,7 +692,11 @@ enum entries_ordinals {
 #define DeclVoidFuncByORD(name,o,at,args)      \
   void name at { CallORD(void,o,at,args); }
 
-/* These functions return false on error, and save the error info in $^E */
+/* This function returns error code on error, and saves the error info in $^E and Perl_rc */
+#define DeclOSFuncByORD_native(ret,name,o,at,args)     \
+  ret name at { unsigned long rc; return CheckOSError(CallORD(ret,o,at,args)); }
+
+/* These functions return false on error, and save the error info in $^E and Perl_rc */
 #define DeclOSFuncByORD(ret,name,o,at,args)    \
   ret name at { unsigned long rc; return !CheckOSError(CallORD(ret,o,at,args)); }
 #define DeclWinFuncByORD(ret,name,o,at,args)   \
index 03e2fc5..06de95e 100644 (file)
@@ -5750,9 +5750,17 @@ your program.
 You can check all the failure possibilities by inspecting
 C<$?> like this:
 
-    $exit_value  = $? >> 8;
-    $signal_num  = $? & 127;
-    $dumped_core = $? & 128;
+    if ($? == -1) {
+       print "failed to execute: $!\n";
+    }
+    elsif ($? & 127) {
+       printf "child died with signal %d, %s coredump\n",
+           ($? & 127),  ($? & 128) ? 'with' : 'without';
+    }
+    else {
+       printf "child exited with value %d\n", $? >> 8;
+    }
+
 
 or more portably by using the W*() calls of the POSIX extension;
 see L<perlport> for more information.
index 1538f69..04ef75d 100755 (executable)
@@ -125,7 +125,8 @@ END
 END
     close CMDPIPE;
     $? >>= 8 if $^O eq 'VMS'; # POSIX status hiding in 2nd byte
-    print $? & 0xFF ? "ok 6\n" : "not ok 6\n";
+    my $todo = ($^O eq 'os2' ? ' # TODO: EMX v0.9d_fix4 bug: wrong nibble? ' : '');
+    print $? & 0xFF ? "ok 6$todo\n" : "not ok 6$todo\n";
 
     $test += 4;
 }