From: Jarkko Hietaniemi Date: Sun, 24 May 1998 16:13:21 +0000 (+0300) Subject: 5.004_65: the infamous semctl() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1abb42fe05605796a5aa3903270aa1e38a3bcec9;p=p5sagit%2Fp5-mst-13.2.git 5.004_65: the infamous semctl() p4raw-id: //depot/perl@1041 --- diff --git a/t/op/ipcmsg.t b/t/op/ipcmsg.t index 0fb9726..52fb1a2 100755 --- a/t/op/ipcmsg.t +++ b/t/op/ipcmsg.t @@ -30,12 +30,15 @@ BEGIN { print "1..0\n"; exit; } + + use strict; + my @incpath = (split(/\s+/, $Config{usrinc}), split(/\s+/ ,$Config{locincpth})); my %done = (); my %define = (); sub process_file { - my($file) = @_; + my($file,$level) = @_; return unless defined $file; @@ -52,15 +55,18 @@ BEGIN { $done{$path} = 1; unless(defined $path) { - warn "Cannot find '$file'"; + warn "Cannot find '$file'" if $level == 0; return; } + local *F; + open(F,$path) or return; + $level = 0 unless defined $level; while() { s#/\*.*(\*/|$)##; - process_file($mm,$1) + process_file($1,$level+1) if /^#\s*include\s*[<"]([^>"]+)[>"]/; s/(?:\([^)]*\)\s*)//; @@ -75,7 +81,7 @@ BEGIN { process_file("sys/ipc.h"); process_file("sys/stat.h"); - foreach $d (@define) { + foreach my $d (@define) { while(defined($define{$d}) && $define{$d} !~ /^(0x)?\d+$/) { $define{$d} = exists $define{$define{$d}} ? $define{$define{$d}} : undef; @@ -83,8 +89,11 @@ BEGIN { unless(defined $define{$d}) { print "1..0\n"; exit; - }; - ${ $d } = eval $define{$d}; + } + { + no strict 'refs'; + ${ $d } = eval $define{$d}; + } } } diff --git a/t/op/ipcsem.t b/t/op/ipcsem.t index 98a2398..6839466 100755 --- a/t/op/ipcsem.t +++ b/t/op/ipcsem.t @@ -30,12 +30,15 @@ BEGIN { print "1..0\n"; exit; } + + use strict; + my @incpath = (split(/\s+/, $Config{usrinc}), split(/\s+/ ,$Config{locincpth})); my %done = (); my %define = (); sub process_file { - my($file) = @_; + my($file, $level) = @_; return unless defined $file; @@ -52,15 +55,18 @@ BEGIN { $done{$path} = 1; unless(defined $path) { - warn "Cannot find '$file'"; + warn "Cannot find '$file'" if $level == 0; return; } + local *F; + open(F,$path) or return; + $level = 0 unless defined $level; while() { s#/\*.*(\*/|$)##; - process_file($mm,$1) + process_file($1,$level+1) if /^#\s*include\s*[<"]([^>"]+)[>"]/; s/(?:\([^)]*\)\s*)//; @@ -75,7 +81,7 @@ BEGIN { process_file("sys/ipc.h"); process_file("sys/stat.h"); - foreach $d (@define) { + foreach my $d (@define) { while(defined($define{$d}) && $define{$d} !~ /^(0x)?\d+$/) { $define{$d} = exists $define{$define{$d}} ? $define{$define{$d}} : undef; @@ -84,17 +90,15 @@ BEGIN { print "1..0\n"; exit; }; - ${ $d } = eval $define{$d}; + { + no strict 'refs'; + ${ $d } = eval $define{$d}; + } } } use strict; -# This test doesn't seem to work properly yet so skip it for _65 -print "1..0\n"; -exit; - - print "1..10\n"; my $sem = semget($IPC_PRIVATE, 10, $S_IRWXU | $S_IRWXG | $S_IRWXO | $IPC_CREAT)