Re: [PATCH 17/18] Place the open() call inside the do{} struct and prevent failing close
- From
Célestin Matte <celestin.matte@ensimag.fr>
- Date
- Jun 6, 2013, 22:16 UTC
- Message-ID
- <51B10A57.6060900@ensimag.fr>
- In-Reply-To
- <7vbo7iyk8e.fsf@alter.siamese.dyndns.org>
Le 06/06/2013 23:58, Junio C Hamano a écrit :
Show 16 quoted lines
> Célestin Matte <celestin.matte@ensimag.fr> writes: > >> So using autodie may not be a good idea. >> But the problem is that in the current state, open() return values are >> checked, but print ones are not, although it should be. > > I tried "man autodie" and tried to spot 'print' in the categories > list that shows things like ":all covers :default which in turn > covers :io which in turn covers read, seek, ..." and didn't see any. > > Running the attached as > > $ perl ad.perl >&- > > gave me "Hi" (i.e. no failure from print) but of course killed a > failing syswrite().
You're right, print is not in the list of function checked by autodie.
> So I am not sure your "we must check print" matches well with use of > autodie, either.
So I'm not sure what we should do for print calls: should we systematically check them all? That would be a painful and less-readable thing to do. We may just not bother about it, after all...