Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 2024 17:55:46 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 62a52c154224 - main - loader: export the CMD_ constants in loader table
Message-ID:  <202402141755.41EHtk2T083051@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=62a52c15422470f97fc7b311d89c83f910bcc1b1

commit 62a52c15422470f97fc7b311d89c83f910bcc1b1
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-02-14 17:51:58 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-02-14 17:55:38 +0000

    loader: export the CMD_ constants in loader table
    
    Export the CMD_OK, etc constants in the loader table. They are the
    return values of loader.perform, etc.
    
    Sponsored by:           Netflix
    Differential Revision:  https://reviews.freebsd.org/D43821
---
 stand/liblua/lutils.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/stand/liblua/lutils.c b/stand/liblua/lutils.c
index 274d9a39da21..8066d3f685f7 100644
--- a/stand/liblua/lutils.c
+++ b/stand/liblua/lutils.c
@@ -639,6 +639,16 @@ luaopen_loader(lua_State *L)
 	lua_setfield(L, -2, "lua_path");
 	lua_pushinteger(L, bootprog_rev);
 	lua_setfield(L, -2, "version");
+	lua_pushinteger(L, CMD_OK);
+	lua_setfield(L, -2, "CMD_OK");
+	lua_pushinteger(L, CMD_WARN);
+	lua_setfield(L, -2, "CMD_WARN");
+	lua_pushinteger(L, CMD_ERROR);
+	lua_setfield(L, -2, "CMD_ERROR");
+	lua_pushinteger(L, CMD_CRIT);
+	lua_setfield(L, -2, "CMD_CRIT");
+	lua_pushinteger(L, CMD_FATAL);
+	lua_setfield(L, -2, "CMD_FATAL");
 	lua_add_features(L);
 	/* Set global printc to loader.printc */
 	lua_register(L, "printc", lua_printc);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202402141755.41EHtk2T083051>