Subject: Re: kern/36673: dubious code in sysmon_envsys
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Juan RP <juan@xtrarom.org>
List: netbsd-bugs
Date: 07/21/2007 15:35:02
The following reply was made to PR kern/36673; it has been noted by GNATS.

From: Juan RP <juan@xtrarom.org>
To: gnats-bugs@NetBSD.org
Cc: yamt@mwd.biglobe.ne.jp
Subject: Re: kern/36673: dubious code in sysmon_envsys
Date: Sat, 21 Jul 2007 17:33:02 +0200

 On Sat, 21 Jul 2007 11:35:00 +0000 (UTC)
 yamt@mwd.biglobe.ne.jp wrote:
 
 Ok, I've made a few changes... let's see what's missing now.
 
 > 	- sme_register_sensorname doesn't need to handle EMPTY case
 > specially.
 
 Fixed.
 
 > 	- sme_make_dictionary should fully set up a dictionary before
 > 	 adding it to the array.  (instead of leaving a partial
 > dictionary on errors.)
 > 	 same for sysmon_envsys_createplist and its array.
 > 
 > 	- ENVSYS_FDUPDESC seems broken for compat ioctls.
 
 Fixed.
 
 > 	- what global mutexes like sme_mtx protect is not clear.
 
 I believe they are used ok, correct me if I'm wrong.
 
 > 	- 'obj' argument of sme_sensor_upstring (and similar
 > functions) is useless.
 
 Fixed.
 
 > 	- '--sme->sme_nsensors' in sme_update_dictionary seems quite
 > dubious.
 
 This is the only one that I'm not sure why you are complaining, it
 works ok... do you know any other way to skip sensors with duplicate
 descriptions?
 
 > 	- sysmon_envsys_createplist seems to ignore most errors
 > 	 unless it was for the last sensor in sme_sensor_data[].
 > 	 i don't understand why the last one is special.
 
 It returns the error if there's any now.
 
 -- 
 Juan Romero Pardines 	- The NetBSD Project
 http://plog.xtrarom.org 	- NetBSD/pkgsrc news in Spanish