+/* SPDX-License-Identifier: LGPL-2.1+ */
/***
This file is part of systemd.
if (!dir) {
if (errno == ENOENT)
return 0;
- else {
- log_error("sd-device-enumerator: could not open tags directory %s: %m", path);
- return -errno;
- }
+ else
+ return log_error_errno(errno, "sd-device-enumerator: could not open tags directory %s: %m", path);
}
/* TODO: filter away subsystems? */
int r = 0;
dir = opendir(path);
- if (!dir) {
- log_debug("sd-device-enumerate: could not open parent directory %s: %m", path);
- return -errno;
- }
+ if (!dir)
+ return log_debug_errno(errno, "sd-device-enumerate: could not open parent directory %s: %m", path);
FOREACH_DIRENT_ALL(dent, dir, return -errno) {
_cleanup_free_ char *child = NULL;
if (dent->d_type != DT_DIR)
continue;
- child = strjoin(path, "/", dent->d_name, NULL);
+ child = strjoin(path, "/", dent->d_name);
if (!child)
return -ENOMEM;