| 169 | | /* No user specified label, check for a _label sysfs file */ |
| 170 | | snprintf(path, PATH_MAX, "%s/%s_label", name.busname, |
| 171 | | featureptr->data.name); |
| 172 | | |
| 173 | | if ((f = fopen(path, "r"))) { |
| 174 | | i = fread(buf, 1, sizeof(buf) - 1, f); |
| 175 | | fclose(f); |
| 176 | | if (i > 0) { |
| 177 | | /* i - 1 to strip the '\n' at the end */ |
| 178 | | buf[i - 1] = 0; |
| 179 | | *result = strdup(buf); |
| 180 | | goto sensors_get_label_exit; |
| | 168 | if (sensors_found_sysfs) { |
| | 169 | char buf[128], path[PATH_MAX]; |
| | 170 | FILE *f; |
| | 171 | |
| | 172 | /* No user specified label, check for a _label sysfs file */ |
| | 173 | snprintf(path, PATH_MAX, "%s/%s_label", name.busname, |
| | 174 | featureptr->data.name); |
| | 175 | |
| | 176 | if ((f = fopen(path, "r"))) { |
| | 177 | i = fread(buf, 1, sizeof(buf) - 1, f); |
| | 178 | fclose(f); |
| | 179 | if (i > 0) { |
| | 180 | /* i - 1 to strip the '\n' at the end */ |
| | 181 | buf[i - 1] = 0; |
| | 182 | *result = strdup(buf); |
| | 183 | goto sensors_get_label_exit; |
| | 184 | } |