Currently, for sysfs paths outside of /sys/devices/ we do better
checking if something is a suitable path: we check if it's actually a
directory, and if not return ENODEV.
Let's make the codepath for nodes *inside* of /sys/device/ similar:
let's also return ENODEV if the path supplied is not a directory.
Previously, we'd return ENOTDIR in that case, which is quite confusing I
think.
* Hence, use log_trace_errno() here. */
return log_trace_errno(SYNTHETIC_ERRNO(ENODEV),
"sd-device: the uevent file \"%s/uevent\" does not exist.", syspath);
+ if (errno == ENOTDIR)
+ /* Not actually a directory. */
+ return log_debug_errno(SYNTHETIC_ERRNO(ENODEV),
+ "sd-device: the syspath \"%s\" is not a directory.", syspath);
return log_debug_errno(errno, "sd-device: cannot find uevent file for %s: %m", syspath);
}