summaryrefslogtreecommitdiffstats
path: root/src/sleep/battery-capacity.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:40 +0000
commitfc53809803cd2bc2434e312b19a18fa36776da12 (patch)
treeb4b43bd6538f51965ce32856e9c053d0f90919c8 /src/sleep/battery-capacity.c
parentAdding upstream version 255.5. (diff)
downloadsystemd-fc53809803cd2bc2434e312b19a18fa36776da12.tar.xz
systemd-fc53809803cd2bc2434e312b19a18fa36776da12.zip
Adding upstream version 256.upstream/256
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/sleep/battery-capacity.c')
-rw-r--r--src/sleep/battery-capacity.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sleep/battery-capacity.c b/src/sleep/battery-capacity.c
index 62a0746..5667a59 100644
--- a/src/sleep/battery-capacity.c
+++ b/src/sleep/battery-capacity.c
@@ -68,7 +68,7 @@ static int siphash24_compress_id128(
if (r < 0)
return log_debug_errno(r, "Failed to get %s ID: %m", name);
- siphash24_compress(&id, sizeof(sd_id128_t), state);
+ siphash24_compress_typesafe(id, state);
return 0;
}
@@ -123,7 +123,7 @@ static int get_battery_discharge_rate(sd_device *dev, int *ret) {
break;
p = line;
- r = extract_many_words(&p, NULL, 0, &stored_hash_id, &stored_discharge_rate, NULL);
+ r = extract_many_words(&p, NULL, 0, &stored_hash_id, &stored_discharge_rate);
if (r < 0)
return log_debug_errno(r, "Failed to parse hash_id and discharge_rate read from " DISCHARGE_RATE_FILEPATH ": %m");
if (r != 2)
@@ -142,7 +142,7 @@ static int get_battery_discharge_rate(sd_device *dev, int *ret) {
return log_device_debug_errno(dev, r, "Failed to parse discharge rate read from " DISCHARGE_RATE_FILEPATH ": %m");
if (!battery_discharge_rate_is_valid(discharge_rate))
- return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ERANGE), "Invalid battery discharge percentage rate per hour: %m");
+ return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ERANGE), "Invalid battery discharge percentage rate per hour.");
*ret = discharge_rate;
return 0; /* matching device found, exit iteration */
@@ -157,7 +157,7 @@ static int put_battery_discharge_rate(int estimated_battery_discharge_rate, uint
if (!battery_discharge_rate_is_valid(estimated_battery_discharge_rate))
return log_debug_errno(SYNTHETIC_ERRNO(ERANGE),
- "Invalid battery discharge rate %d%% per hour: %m",
+ "Invalid battery discharge rate %d%% per hour.",
estimated_battery_discharge_rate);
r = write_string_filef(