Re: [PATCH 17/18] Place the open() call inside the do{} struct and prevent failing close

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Célestin Matte <celestin.matte@xxxxxxxxxx> 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().

So I am not sure your "we must check print" matches well with use of
autodie, either.

-- >8 --
#!/usr/bin/perl -w

use warnings;
use autodie;

for (my $i = 0; $i < 256; $i++) {
	print "Did this die?\n";
}

print STDERR "Hi\n";

for (my $i = 0; $i < 256; $i++) {
	syswrite(1, "Did this die?\n");
}

print STDERR "Lo\n";

exit(0);
--- 8< --

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]