From d3d71187786743ba1924f613e5bb7f20f236caff Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 10 Nov 2006 09:19:48 +0000 Subject: [PATCH] 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 --- CHANGES | 1 + prog/detect/sensors-detect | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 79d1c799..249dd128 100644 --- a/CHANGES +++ b/CHANGES @@ -22,6 +22,7 @@ SVN HEAD Program sensors-detect: Add SMSC DME1737 detection Add EPoX EP1308 detection (Hans Edgington) Add Intel Core thermal sensor detection + Preallocate memory for I2C_FUNCS ioctl (#2138) 2.10.1 (20060924) File doc/developers/checklist renamed to dev/developers/release_checklist diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index a8911375..f11b3b01 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -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;