Signed-off-by: Karel Zak <kzak@redhat.com>
rc = ul_path_read(pc, buf, sizeof(buf) - 1, path);
if (rc < 0 || !str)
rc = ul_path_read(pc, buf, sizeof(buf) - 1, path);
if (rc < 0 || !str)
/* Remove tailing newline (usual in sysfs) */
if (rc > 0 && *(buf + rc - 1) == '\n')
/* Remove tailing newline (usual in sysfs) */
if (rc > 0 && *(buf + rc - 1) == '\n')
{
int rc = ul_path_read(pc, buf, bufsz - 1, path);
if (rc < 0)
{
int rc = ul_path_read(pc, buf, bufsz - 1, path);
if (rc < 0)
/* Remove tailing newline (usual in sysfs) */
if (rc > 0 && *(buf + rc - 1) == '\n')
/* Remove tailing newline (usual in sysfs) */
if (rc > 0 && *(buf + rc - 1) == '\n')
return ul_path_read_s64(pc, res, p);
}
return ul_path_read_s64(pc, res, p);
}