| Index: ports/gambc_ppapi/main.c
|
| diff --git a/ports/lua_ppapi/main.c b/ports/gambc_ppapi/main.c
|
| similarity index 62%
|
| copy from ports/lua_ppapi/main.c
|
| copy to ports/gambc_ppapi/main.c
|
| index 6e612ccf40ad173063f109b9d978ee2e6c570762..ab840ffb6d1320f455847ec3dd47cb362765c283 100644
|
| --- a/ports/lua_ppapi/main.c
|
| +++ b/ports/gambc_ppapi/main.c
|
| @@ -4,19 +4,19 @@
|
|
|
| #include <assert.h>
|
| #include <fcntl.h>
|
| -#include <libtar.h>
|
| #include <limits.h>
|
| #include <stdio.h>
|
| #include <stdlib.h>
|
| #include <string.h>
|
| #include <sys/mount.h>
|
| +#include <sys/stat.h>
|
| #include <unistd.h>
|
|
|
| #include "ppapi_simple/ps_main.h"
|
|
|
| -int lua_main(int argc, char **argv);
|
| +int gambc_main(int argc, char **argv);
|
|
|
| -static int setup_unix_environment(const char* tarfile) {
|
| +static int setup_unix_environment() {
|
| int ret = umount("/");
|
| if (ret) {
|
| printf("unmounting root fs failed\n");
|
| @@ -38,7 +38,7 @@ static int setup_unix_environment(const char* tarfile) {
|
|
|
| const char* data_url = getenv("DATA_URL");
|
| if (!data_url)
|
| - data_url = "./";
|
| + data_url = "./scm";
|
|
|
| ret = mount(data_url, "/mnt/http", "httpfs", 0,
|
| "allow_cross_origin_requests=true,allow_credentials=false");
|
| @@ -51,28 +51,6 @@ static int setup_unix_environment(const char* tarfile) {
|
| // fail in incognito mode.
|
| mount("/", "/mnt/html5", "html5fs", 0, "");
|
|
|
| - // Extra tar achive from http filesystem.
|
| - if (tarfile) {
|
| - TAR* tar;
|
| - char filename[PATH_MAX];
|
| - strcpy(filename, "/mnt/http/");
|
| - strcat(filename, tarfile);
|
| - ret = tar_open(&tar, filename, NULL, O_RDONLY, 0, 0);
|
| - if (ret) {
|
| - printf("error opening: %s\n", filename);
|
| - return 1;
|
| - }
|
| -
|
| - ret = tar_extract_all(tar, "/");
|
| - if (ret) {
|
| - printf("error extracting: %s\n", filename);
|
| - return 1;
|
| - }
|
| -
|
| - ret = tar_close(tar);
|
| - assert(ret == 0);
|
| - }
|
| -
|
| // Setup environment
|
| setenv("HOME", "/home", 1);
|
| setenv("PATH", "/bin", 1);
|
| @@ -81,13 +59,11 @@ static int setup_unix_environment(const char* tarfile) {
|
| return 0;
|
| }
|
|
|
| -int lua_ppapi_main(int argc, char **argv) {
|
| - if (setup_unix_environment("luadata.tar"))
|
| +int gambc_ppapi_main(int argc, char **argv) {
|
| + if (setup_unix_environment())
|
| return 1;
|
|
|
| - chdir("/lua-5.2.2-tests");
|
| -
|
| - return lua_main(argc, argv);
|
| + return gambc_main(argc, argv);
|
| }
|
|
|
| -PPAPI_SIMPLE_REGISTER_MAIN(lua_ppapi_main)
|
| +PPAPI_SIMPLE_REGISTER_MAIN(gambc_ppapi_main)
|
|
|