File: initial_eof.t

package info (click to toggle)
speedy-cgi-perl 2.22-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,128 kB
  • ctags: 890
  • sloc: ansic: 4,487; sh: 1,105; perl: 945; makefile: 89
file content (21 lines) | stat: -rw-r--r-- 539 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

# Solaris's select() won't wake up when stdin is initially EOF.
# To reproduce this bug, compile on Solaris with USE_SELECT defined.

# SGI's select won't wake up when script output is redirected to /dev/null.

print "1..2\n";

sub wakeup { print "not ok\n"; exit }

$SIG{ALRM} = \&wakeup;

alarm(3);
my $line = `$ENV{SPEEDY} t/scripts/initial_eof </dev/null`;
print $line =~ /ok/ ? "ok\n" : "not ok\n";

alarm(3);
$line = `$ENV{SPEEDY} t/scripts/initial_eof <t/scripts/initial_eof >/dev/null`;
print $? ? "not ok\n" : "ok\n";

alarm(0);