Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/modules/lua lua(4): fixed require



details:   https://anonhg.NetBSD.org/src/rev/a0c5167286d6
branches:  trunk
changeset: 804810:a0c5167286d6
user:      lneto <lneto%NetBSD.org@localhost>
date:      Sun Nov 30 19:15:03 2014 +0000

description:
lua(4): fixed require

diffstat:

 sys/modules/lua/lua.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r f3342bce2bbd -r a0c5167286d6 sys/modules/lua/lua.c
--- a/sys/modules/lua/lua.c     Sun Nov 30 19:12:59 2014 +0000
+++ b/sys/modules/lua/lua.c     Sun Nov 30 19:15:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lua.c,v 1.14 2014/09/24 14:55:48 mbalmer Exp $ */
+/*     $NetBSD: lua.c,v 1.15 2014/11/30 19:15:03 lneto Exp $ */
 
 /*
  * Copyright (c) 2014 by Lourival Vieira Neto <lneto%NetBSD.org@localhost>.
@@ -367,7 +367,11 @@
                                                            m->mod_name,
                                                            s->lua_name);
                                                klua_lock(s->K);
-                                               m->open(s->K->L);
+                                               luaL_requiref(
+                                                       s->K->L,
+                                                       m->mod_name,
+                                                       m->open,
+                                                       1);
                                                klua_unlock(s->K);
                                                m->refcount++;
                                                LIST_INSERT_HEAD(
@@ -507,7 +511,8 @@
                                        device_printf(sc_self,
                                            "require module %s\n",
                                            md->mod_name);
-                               md->open(L);
+                               luaL_requiref(L, md->mod_name, md->open, 0);
+
                                md->refcount++;
                                LIST_INSERT_HEAD(&s->lua_modules, md, mod_next);
                                return 1;



Home | Main Index | Thread Index | Old Index