socsvn commit: r269011 - soc2014/pedrosouza/lua_loader/head/sys/boot/common
pedrosouza at FreeBSD.org
pedrosouza at FreeBSD.org
Tue Jun 3 15:28:28 UTC 2014
Author: pedrosouza
Date: Tue Jun 3 15:28:27 2014
New Revision: 269011
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=269011
Log:
Add copyright, fix comment & check formatting
Modified:
soc2014/pedrosouza/lua_loader/head/sys/boot/common/interp_lua.c
Modified: soc2014/pedrosouza/lua_loader/head/sys/boot/common/interp_lua.c
==============================================================================
--- soc2014/pedrosouza/lua_loader/head/sys/boot/common/interp_lua.c Tue Jun 3 14:50:51 2014 (r269010)
+++ soc2014/pedrosouza/lua_loader/head/sys/boot/common/interp_lua.c Tue Jun 3 15:28:27 2014 (r269011)
@@ -1,3 +1,30 @@
+/*-
+* Copyright (c) 2014 Pedro Souza <pedrosouza at freebsd.org>
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+* SUCH DAMAGE.
+*
+*/
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -38,7 +65,6 @@
int
lua_perform(lua_State *L)
{
-
int argc, ret;
char **argv;
int res = -1;
@@ -90,7 +116,7 @@
data_chunk ds;
ds.data = (void*)str;
ds.size = size;
- res = lua_load(L, read_chunk, &ds, "do_string___", 0);
+ res = lua_load(L, read_chunk, &ds, "do_string", 0);
res = lua_pcall(L, 0, LUA_MULTRET, 0);
return res;
}
@@ -137,6 +163,7 @@
int
interp_lua_incl(void *ctx, const char *filename)
{
+#if 0
lua_State *luap;
struct interp_lua_softc *softc;
struct stat st;
@@ -144,7 +171,7 @@
int fd, filebufoff, i, rleft, rread;
printf("[Lua] Including file %s.\n", filename);
- /*
+
if ((strcmp(filename, "/boot/loader.rc") == 0) ||
(strcmp(filename, "/boot/boot.conf") == 0)) {
printf("Skipping loader.rc and boot.conf");
@@ -165,13 +192,13 @@
filebuf = malloc(st.st_size);
assert(filebuf != NULL);
memset(filebuf, 0, st.st_size);
- */
+
/*
* XX: Investigate stat() vs logic problem. I'm getting
* more bytes that the file really has.
*/
- /*
+
rleft = st.st_size - 1;
filebufoff = 0;
for (;;) {
@@ -195,7 +222,7 @@
printf("\t'%s'\n\n", errstr);
lua_pop(luap, 1);
}
- */
+#endif
return (0);
}
More information about the svn-soc-all
mailing list