From: Lennart Poettering Date: Tue, 23 May 2023 18:45:40 +0000 (+0200) Subject: fdset: minor modernizations X-Git-Tag: v254-rc1~404^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42dc1cd4680b6e3f1ef7097a7ec2e508a52f32ef;p=thirdparty%2Fsystemd.git fdset: minor modernizations --- diff --git a/src/shared/fdset.c b/src/shared/fdset.c index 86b3139999e..397918c20bb 100644 --- a/src/shared/fdset.c +++ b/src/shared/fdset.c @@ -163,11 +163,14 @@ int fdset_new_fill( return -ENOMEM; FOREACH_DIRENT(de, d, return -errno) { - int fd = -EBADF; + int fd; - r = safe_atoi(de->d_name, &fd); - if (r < 0) - return r; + if (!IN_SET(de->d_type, DT_LNK, DT_UNKNOWN)) + continue; + + fd = parse_fd(de->d_name); + if (fd < 0) + return fd; if (fd < 3) continue;