git: 06f98df4b7a3 - stable/14 - stand: lua: break out a few more dirent types in lfs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 12 Apr 2026 13:44:29 UTC
The branch stable/14 has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=06f98df4b7a3a16e19166e6007c8023dc9098ffd
commit 06f98df4b7a3a16e19166e6007c8023dc9098ffd
Author: Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2026-03-09 21:38:57 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2026-04-12 13:43:46 +0000
stand: lua: break out a few more dirent types in lfs
These are non-standard and specific to the version used in loader. We
have some desire to recognize symlinks to avoid filtering out kernel
symlinks in the autodetection bits when they would be perfectly fine to
`load`.
This won't be usable right away, so any impending use will need to be
careful to account for nil.
Reported by: leres
(cherry picked from commit bc531a96c9b28b1cabcd5deb0c9f8f6d815cfebc)
---
libexec/flua/modules/lfs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libexec/flua/modules/lfs.c b/libexec/flua/modules/lfs.c
index 8cb8d6fc9fed..259860b4017c 100644
--- a/libexec/flua/modules/lfs.c
+++ b/libexec/flua/modules/lfs.c
@@ -443,6 +443,10 @@ luaopen_lfs(lua_State *L)
/* Non-standard extension for loader, used with lfs.dir(). */
lua_pushinteger(L, DT_DIR);
lua_setfield(L, -2, "DT_DIR");
+ lua_pushinteger(L, DT_REG);
+ lua_setfield(L, -2, "DT_REG");
+ lua_pushinteger(L, DT_LNK);
+ lua_setfield(L, -2, "DT_LNK");
#endif
return 1;
}