1
0
mirror of https://github.com/systemd/systemd synced 2026-03-19 19:44:48 +01:00

Compare commits

..

No commits in common. "9952f11a84b333a36e9f1f4a62b951ab84c897f5" and "d3a047b9d1277c92657ad69e210a60e0dbb2f430" have entirely different histories.

View File

@ -2022,17 +2022,13 @@ _public_ int sd_device_get_sysattr_value(sd_device *device, const char *sysattr,
/* skip non-readable files */
return -EPERM;
else {
size_t size;
/* Read attribute value, Some attributes contain embedded '\0'. So, it is necessary to
* also get the size of the result. See issue #20025. */
r = read_full_virtual_file(path, &value, &size);
/* read attribute value */
r = read_full_virtual_file(path, &value, NULL);
if (r < 0)
return r;
/* drop trailing newlines */
while (size > 0 && strchr(NEWLINE, value[--size]))
value[size] = '\0';
delete_trailing_chars(value, "\n");
}
/* Unfortunately, we need to return 'const char*' instead of 'char*'. Hence, failure in caching