From: Yu Watanabe Date: Mon, 31 Jul 2023 18:22:57 +0000 (+0900) Subject: udev-builtin-net_id: skip non-directory entry earlier X-Git-Tag: v255-rc1~856^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4103dca1b5664f937ce125219ca70ea54f810ac8;p=thirdparty%2Fsystemd.git udev-builtin-net_id: skip non-directory entry earlier In the below, we will try to read 'address' file in the directory, hence the entry must be a directory. No functional change, just a tiny optimization. --- diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index a1aba19cba1..76deb254c53 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -429,6 +429,9 @@ static int dev_pci_slot(sd_device *dev, const LinkInfo *info, NetNames *names) { if (dot_or_dot_dot(de->d_name)) continue; + if (de->d_type != DT_DIR) + continue; + r = safe_atou32(de->d_name, &i); if (r < 0 || i <= 0) continue;