2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-30 22:05:11 +00:00

Preallocate memory for the I2C_FUNCS ioctl. This should fix ticket #2138.

It might as well be a bug in Fedora Core 3's perl, but the workaround is
cheap anyway.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4229 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2006-11-10 09:19:48 +00:00
parent c9d758c669
commit d3d7118778
2 changed files with 3 additions and 2 deletions

View File

@@ -2392,9 +2392,9 @@ use constant I2C_FUNC_SMBUS_READ_BYTE => 0x00020000;
sub i2c_get_funcs($)
{
my $file = shift;
my $funcs;
my $funcs = pack "L", 0; # Allocate space
ioctl $file, IOCTL_I2C_FUNCS, $funcs='' or return -1;
ioctl $file, IOCTL_I2C_FUNCS, $funcs or return -1;
$funcs = unpack "L", $funcs;
return $funcs;