File: begin_dup.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 (18 lines) | stat: -rw-r--r-- 391 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

# Test for bug where STDIN/STDOUT could not be duped from within
# a BEGIN clause because fd's 0/1 were closed before parsing perl.

print "1..1\n";
if (fork == 0) {
    open(STDERR, ">/dev/null");
    exec("$ENV{SPEEDY} t/scripts/begin_dup");
    exit(1);
}
my $w = wait;
# print STDERR "wait=$w status=$?\n";
if ($w != -1 && $? == 0) {
    print "ok\n";
} else {
    print "not ok\n";
}