From: Andy Dougherty Date: Wed, 3 Jul 2002 11:56:05 +0000 (-0400) Subject: Re: autom4te and perl 5.8.0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1feb1812070a7e60b7ba9bdbf416adcf10c7b764;p=p5sagit%2Fp5-mst-13.2.git Re: autom4te and perl 5.8.0 Message-ID: (with an additional paranoid nit : skip test unless -c $devnull) p4raw-id: //depot/perl@17398 --- diff --git a/doio.c b/doio.c index 20f6fb3..622778a 100644 --- a/doio.c +++ b/doio.c @@ -667,7 +667,7 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, 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; diff --git a/ext/Fcntl/t/fcntl.t b/ext/Fcntl/t/fcntl.t index 02fd958..d5d772f 100644 --- a/ext/Fcntl/t/fcntl.t +++ b/ext/Fcntl/t/fcntl.t @@ -12,7 +12,7 @@ BEGIN { use Fcntl; -print "1..6\n"; +print "1..7\n"; print "ok 1\n"; @@ -45,7 +45,24 @@ if (sysopen(my $wo, "fcntl$$", O_WRONLY|O_CREAT)) { 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$$"; } -