Message-ID: <Pine.SOL.4.10.
10207031150540.6601-100000@maxwell.phys.lafayette.edu>
(with an additional paranoid nit : skip test unless -c $devnull)
p4raw-id: //depot/perl@17398
if (*s == 'I' || *s == '#')
s++;
*s = 'w';
- if (!(IoOFP(io) = PerlIO_openn(aTHX_ type,mode,fd,0,0,NULL,0,svp))) {
+ if (!(IoOFP(io) = PerlIO_openn(aTHX_ type,s,fd,0,0,NULL,0,svp))) {
PerlIO_close(fp);
IoIFP(io) = Nullfp;
goto say_false;
use Fcntl;
-print "1..6\n";
+print "1..7\n";
print "ok 1\n";
print "not ok 2 # sysopen O_WRONLY failed: $!\n";
}
+# Opening of character special devices gets special treatment in doio.c
+# Didn't work as of perl-5.8.0-RC2.
+use File::Spec; # To portably get /dev/null
+
+my $devnull = File::Spec->devnull;
+if (-c $devnull) {
+ if (sysopen(my $wo, $devnull, O_WRONLY)) {
+ print "ok 7 # open /dev/null O_WRONLY\n";
+ close($wo);
+ }
+ else {
+ print "not ok 7 # open /dev/null O_WRONLY\n";
+ }
+}
+else {
+ print "ok 7 # Skipping /dev/null sysopen O_WRONLY test\n";
+}
+
END {
1 while unlink "fcntl$$";
}
-