develooper Front page | perl.perl5.porters | Postings from July 2013

Re: [perl #117265] [PATCH] e213661 no warnings 'safesyscalls', fatalnul checks

Thread Previous | Thread Next
Ricardo Signes
July 6, 2013 23:10
Re: [perl #117265] [PATCH] e213661 no warnings 'safesyscalls', fatalnul checks
Message ID:
* Father Chrysostomos via RT <> [2013-06-28T02:56:27]
> And mine, too.  Just to be clear, in case we misunderstand each other,
> that means no warnings, just a failed system call, which will be
> detected by the existing error checking code.  (You *do* check the
> return values of your system calls, right? :-)


Here is the only thing that gives me a little pause:  I check those return
values and say something like:

  open ... or die "couldn't open <$filename>: $!";

And if $filename is "foo.txt\0" then the error message is confusing...
...but I don't think it would be in practice, because trailing NULs are just
ignored, rather than cause for a ENOENT.  They're used in 2-arg open to
clear up ambiguity with files ending in a pipe, and we can keep allowing and
ignoring them.  In any other case, the error message will contain non-nuls
after the nuls, and we're good.  (In the unlikely event of $realname . $nul .
$zerowidth, well, the programmer will have to debug.)


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About