1
0
mirror of https://github.com/systemd/systemd synced 2026-04-11 01:24:50 +02:00

Compare commits

..

No commits in common. "05c1b1c95edb3b2d051b5b60e5a0519e23b221ab" and "d4453d5ee8819590fbfb068762c4d301d58759c1" have entirely different histories.

2 changed files with 11 additions and 16 deletions

View File

@ -1812,7 +1812,7 @@ static int device_sysattrs_read_all_internal(sd_device *device, const char *subd
if (lstat(path, &statbuf) != 0) if (lstat(path, &statbuf) != 0)
continue; continue;
if ((statbuf.st_mode & (S_IRUSR | S_IWUSR)) == 0) if (!(statbuf.st_mode & S_IRUSR))
continue; continue;
r = set_put_strdup(&device->sysattrs, p ?: dent->d_name); r = set_put_strdup(&device->sysattrs, p ?: dent->d_name);

View File

@ -73,7 +73,6 @@ static int print_all_attributes(sd_device *device, bool is_parent) {
_cleanup_free_ SysAttr *sysattrs = NULL; _cleanup_free_ SysAttr *sysattrs = NULL;
const char *name, *value; const char *name, *value;
size_t n_items = 0; size_t n_items = 0;
int r;
value = NULL; value = NULL;
(void) sd_device_get_devpath(device, &value); (void) sd_device_get_devpath(device, &value);
@ -97,8 +96,9 @@ static int print_all_attributes(sd_device *device, bool is_parent) {
if (skip_attribute(name)) if (skip_attribute(name))
continue; continue;
r = sd_device_get_sysattr_value(device, name, &value); if (sd_device_get_sysattr_value(device, name, &value) < 0)
if (r >= 0) { continue;
/* skip any values that look like a path */ /* skip any values that look like a path */
if (value[0] == '/') if (value[0] == '/')
continue; continue;
@ -110,11 +110,6 @@ static int print_all_attributes(sd_device *device, bool is_parent) {
if (len > 0) if (len > 0)
continue; continue;
} else if (r == -EPERM)
value = "(write-only)";
else
continue;
if (!GREEDY_REALLOC(sysattrs, n_items + 1)) if (!GREEDY_REALLOC(sysattrs, n_items + 1))
return log_oom(); return log_oom();