Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/modules/lua Pull up following revision(s) (requested ...



details:   https://anonhg.NetBSD.org/src/rev/4c9296410d67
branches:  netbsd-7
changeset: 800259:4c9296410d67
user:      snj <snj%NetBSD.org@localhost>
date:      Sun Jul 23 06:00:39 2017 +0000

description:
Pull up following revision(s) (requested by mbalmer in ticket #1422):
        sys/modules/lua/lua.c: revision 1.22 via patch
Only load a module if it is not already loaded in a state (much like
userland Lua handles require).
Fixes PR kern/52226.

diffstat:

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

diffs (25 lines):

diff -r 0b17f65923ec -r 4c9296410d67 sys/modules/lua/lua.c
--- a/sys/modules/lua/lua.c     Sun Jul 23 05:55:03 2017 +0000
+++ b/sys/modules/lua/lua.c     Sun Jul 23 06:00:39 2017 +0000
@@ -1,8 +1,8 @@
-/*     $NetBSD: lua.c,v 1.13.2.4 2017/07/23 05:55:03 snj Exp $ */
+/*     $NetBSD: lua.c,v 1.13.2.5 2017/07/23 06:00:39 snj Exp $ */
 
 /*
+ * Copyright (c) 2011 - 2017 by Marc Balmer <mbalmer%NetBSD.org@localhost>.
  * Copyright (c) 2014 by Lourival Vieira Neto <lneto%NetBSD.org@localhost>.
- * Copyright (c) 2011, 2013 by Marc Balmer <mbalmer%NetBSD.org@localhost>.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -513,6 +513,10 @@
        if (md != NULL)
                LIST_FOREACH(s, &lua_states, lua_next)
                        if (s->K->L == L) {
+                               LIST_FOREACH(m, &s->lua_modules, mod_next)
+                                       if (m == md)
+                                               return 1;
+
                                if (lua_verbose)
                                        device_printf(sc_self,
                                            "require module %s\n",



Home | Main Index | Thread Index | Old Index