]> git.pld-linux.org Git - packages/openhpi.git/commitdiff
- don't use obsolete API (sysfs_read_attribute_value); ready for sysfsutils 2.0.0
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 24 Jan 2006 19:04:29 +0000 (19:04 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    openhpi-sysfs2.patch -> 1.1

openhpi-sysfs2.patch [new file with mode: 0644]

diff --git a/openhpi-sysfs2.patch b/openhpi-sysfs2.patch
new file mode 100644 (file)
index 0000000..bd5303c
--- /dev/null
@@ -0,0 +1,76 @@
+--- openhpi-2.3.1/plugins/sysfs/sysfs2hpi.c.orig       2005-10-27 05:00:47.000000000 +0200
++++ openhpi-2.3.1/plugins/sysfs/sysfs2hpi.c    2006-01-24 19:41:23.444302750 +0100
+@@ -636,7 +636,7 @@
+                                       SaHpiEventStateT *state)
+ {
+       struct sensor *s;
+-      char tmp[SCRATCHSIZE];
++      struct sysfs_attribute *tmpattr;
+       struct oh_handler_state *inst = (struct oh_handler_state *)hnd;
+         SaHpiRdrT *tmprdr;
+@@ -673,12 +673,19 @@
+       *state = 0x0000;
+-      if (sysfs_read_attribute_value(s->value->path,tmp,SCRATCHSIZE)) {
++      if ((tmpattr = sysfs_open_attribute(s->value->path)) == NULL) {
+               dbg("error attempting to read value of %s",s->name);
+               return SA_ERR_HPI_INVALID_DATA;
+       }
++      
++      if (sysfs_read_attribute(tmpattr)) {
++              dbg("error attempting to read value of %s",s->name);
++              sysfs_close_attribute(tmpattr);
++              return SA_ERR_HPI_INVALID_DATA;
++      }
+-        reading_int64_set(reading, atoi(tmp));
++        reading_int64_set(reading, atoi(tmpattr->value));
++      sysfs_close_attribute(tmpattr);
+       
+       return 0;
+ }
+@@ -708,7 +715,7 @@
+                                               SaHpiSensorThresholdsT *thres)
+ {
+       struct sensor *s;
+-      char tmp[SCRATCHSIZE];
++      struct sysfs_attribute *tmpattr;
+       struct oh_handler_state *inst = (struct oh_handler_state *)hnd;
+       SaHpiRdrT *tmprdr;
+@@ -746,17 +753,29 @@
+        * Setting ValuesPresent for all other items to 0.
+        */
+       /* get min values */
+-        if (sysfs_read_attribute_value(s->min->path,tmp,SCRATCHSIZE)) {
++        if ((tmpattr = sysfs_open_attribute(s->min->path)) == NULL) {
++                dbg("error attempting to read value of %s",s->name);
++                return SA_ERR_HPI_INVALID_DATA;
++        }
++        if (sysfs_read_attribute(tmpattr)) {
+                 dbg("error attempting to read value of %s",s->name);
++              sysfs_close_attribute(tmpattr);
+                 return SA_ERR_HPI_INVALID_DATA;
+         }
+-        reading_int64_set(&thres->LowCritical, atoi(tmp));
++        reading_int64_set(&thres->LowCritical, atoi(tmpattr->value));
++      sysfs_close_attribute(tmpattr);
+-        if (sysfs_read_attribute_value(s->max->path,tmp,SCRATCHSIZE)) {
++        if ((tmpattr = sysfs_open_attribute(s->max->path)) == NULL) {
++                dbg("error attempting to read value of %s",s->name);
++                return SA_ERR_HPI_INVALID_DATA;
++        }
++        if (sysfs_read_attribute(tmpattr)) {
+                 dbg("error attempting to read value of %s",s->name);
++              sysfs_close_attribute(tmpattr);
+                 return SA_ERR_HPI_INVALID_DATA;
+         }
+-        reading_int64_set(&thres->UpCritical, atoi(tmp));
++        reading_int64_set(&thres->UpCritical, atoi(tmpattr->value));
++      sysfs_close_attribute(tmpattr);
+         thres->LowMajor.IsSupported = SAHPI_FALSE;
+         thres->LowMinor.IsSupported = SAHPI_FALSE;
This page took 0.026135 seconds and 4 git commands to generate.