[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: [PATCH 5.5.63] warn on flock() on closed handle



On Fri, Jan 14, 2000 at 03:15:24PM -0600, Greg Bacon wrote:
> This patch supercedes the previous patch (i.e., apply it to a virgin
> 5.5.63).
> 
> At Sarathy's suggestion, this patch adds Perl_ck_open_dir to util.c.
> Perl_ck_open_dir takes an operator name, an IO*, and the IO*'s parent
> GV*.  If IoDIRP(io) is non-NULL, it emits a warning modifier (one
> warning will have already fired) asking whether the user thinks he's
> operating on a dirhandle.
> 
> Hm.  The code is much simpler than its description.  Like one of my
> coworkers is fond of saying: "Nothing documents code like code." :-)
> 
> diff -rc perl5.005_63.dist/pod/perldiag.pod perl5.005_63/pod/perldiag.pod
> *** perl5.005_63.dist/pod/perldiag.pod	Wed Dec  8 00:23:13 1999
> --- perl5.005_63/pod/perldiag.pod	Fri Jan 14 14:30:09 2000
> ***************
> *** 3557,3559 ****
> --- 3557,3566 ----
>   
>   =back
>   
> + =item Flock on closed filehandle
> + 
> + (W) The filehandle you're attempting flock() got itself closed sometime

Insert the word 'to' after 'attempting'.


> + before now.  Check your logic flow.  flock() operates on filehandles.
> + Are you attempting to call flock() on a dirhandle by the same name?


Would there be any interest in a patch to perldiag that standardized the
text for these 'X on closed filehandle' errors?  There are three or four
different phrasings for warnings of this type, some of which, such as the
above, seem to ignore the possibility that the filehandle was never opened
in the first place.


Ronald


References to:
Greg Bacon <gbacon@itsc.uah.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]