diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2015-12-21 16:19:01 +0100 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2015-12-21 16:19:01 +0100 |
commit | 79ff22ae426ac43353050b0ccffd7b80a9aa2d01 (patch) | |
tree | 3792063f2f6b6a3868965e0c9c61a80276e3d4d8 /libsensors | |
parent | 48cbe74013f64ae5cd8d47ad56b8fc9e301cd6d3 (diff) | |
parent | 96cccc9f5d4c5908bbc9051242cf1fb43b8d0373 (diff) | |
download | device_samsung_i9300-79ff22ae426ac43353050b0ccffd7b80a9aa2d01.zip device_samsung_i9300-79ff22ae426ac43353050b0ccffd7b80a9aa2d01.tar.gz device_samsung_i9300-79ff22ae426ac43353050b0ccffd7b80a9aa2d01.tar.bz2 |
Merge remote-tracking branch 'cyanogen/cm-13.0' into replicant-6.0
Diffstat (limited to 'libsensors')
-rw-r--r-- | libsensors/input.c | 10 | ||||
-rw-r--r-- | libsensors/smdk4x12_sensors.h | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/libsensors/input.c b/libsensors/input.c index eef2a8d..da3d6d7 100644 --- a/libsensors/input.c +++ b/libsensors/input.c @@ -214,10 +214,10 @@ int sysfs_path_prefix(char *name, char *path_prefix) return -1; } -int sysfs_value_read(char *path) +int64_t sysfs_value_read(char *path) { char buffer[100]; - int value; + int64_t value; int fd = -1; int rc; @@ -232,7 +232,7 @@ int sysfs_value_read(char *path) if (rc <= 0) goto error; - value = atoi(buffer); + value = (int64_t)strtoimax(buffer, NULL, 10); goto complete; error: @@ -245,7 +245,7 @@ complete: return value; } -int sysfs_value_write(char *path, int value) +int sysfs_value_write(char *path, int64_t value) { char buffer[100]; int fd = -1; @@ -258,7 +258,7 @@ int sysfs_value_write(char *path, int value) if (fd < 0) goto error; - snprintf((char *) &buffer, sizeof(buffer), "%d\n", value); + snprintf((char *) &buffer, sizeof(buffer), "%" PRId64 "\n", value); rc = write(fd, buffer, strlen(buffer)); if (rc < (int) strlen(buffer)) diff --git a/libsensors/smdk4x12_sensors.h b/libsensors/smdk4x12_sensors.h index da3d173..7100334 100644 --- a/libsensors/smdk4x12_sensors.h +++ b/libsensors/smdk4x12_sensors.h @@ -83,8 +83,8 @@ int uinput_rel_create(const char *name); void uinput_destroy(int uinput_fd); int input_open(char *name); int sysfs_path_prefix(char *name, char *path_prefix); -int sysfs_value_read(char *path); -int sysfs_value_write(char *path, int value); +int64_t sysfs_value_read(char *path); +int sysfs_value_write(char *path, int64_t value); int sysfs_string_read(char *path, char *buffer, size_t length); int sysfs_string_write(char *path, char *buffer, size_t length); |