| OLD | NEW |
| 1 diff --git a/job.c b/job.c | 1 diff --git a/job.c b/job.c |
| 2 --- a/job.c | 2 --- a/job.c |
| 3 +++ b/job.c | 3 +++ b/job.c |
| 4 @@ -29,6 +29,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. *
/ | 4 @@ -29,6 +29,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. *
/ |
| 5 | 5 |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 | 7 |
| 8 +#if defined(__native_client__) | 8 +#if defined(__native_client__) |
| 9 +# include <spawn.h> | 9 +# include <spawn.h> |
| 10 +#endif | 10 +#endif |
| 11 + | 11 + |
| 12 /* Default shell to use. */ | 12 /* Default shell to use. */ |
| 13 #ifdef WINDOWS32 | 13 #ifdef WINDOWS32 |
| 14 #include <windows.h> | 14 #include <windows.h> |
| 15 diff --git a/main.c b/main.c | 15 diff --git a/main.c b/main.c |
| 16 --- a/main.c | 16 --- a/main.c |
| 17 +++ b/main.c | 17 +++ b/main.c |
| 18 @@ -911,6 +911,9 @@ open_tmpfile(char **name, const char *template) | |
| 19 #ifdef _AMIGA | |
| 20 int | |
| 21 main (int argc, char **argv) | |
| 22 +#elif defined(__native_client__) | |
| 23 +int | |
| 24 +nacl_main (int argc, char **argv) | |
| 25 #else | |
| 26 int | |
| 27 main (int argc, char **argv, char **envp) | |
| 28 @@ -921,6 +924,9 @@ main (int argc, char **argv, char **envp) | 18 @@ -921,6 +924,9 @@ main (int argc, char **argv, char **envp) |
| 29 struct dep *read_makefiles; | 19 struct dep *read_makefiles; |
| 30 PATH_VAR (current_directory); | 20 PATH_VAR (current_directory); |
| 31 unsigned int restarts = 0; | 21 unsigned int restarts = 0; |
| 32 +#if defined(__native_client__) | 22 +#if defined(__native_client__) |
| 33 + char **envp = environ; | 23 + envp = environ; |
| 34 +#endif | 24 +#endif |
| 35 #ifdef WINDOWS32 | 25 #ifdef WINDOWS32 |
| 36 char *unix_path = NULL; | 26 char *unix_path = NULL; |
| 37 char *windows32_path = NULL; | 27 char *windows32_path = NULL; |
| 38 diff --git a/misc.c b/misc.c | 28 diff --git a/misc.c b/misc.c |
| 39 --- a/misc.c | 29 --- a/misc.c |
| 40 +++ b/misc.c | 30 +++ b/misc.c |
| 41 @@ -715,7 +715,7 @@ log_access (const char *flavor) | 31 @@ -715,7 +715,7 @@ log_access (const char *flavor) |
| 42 static void | 32 static void |
| 43 init_access (void) | 33 init_access (void) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 72 #else | 62 #else |
| 73 #ifndef HAVE_SETREGID | 63 #ifndef HAVE_SETREGID |
| 74 +/* TODO(sbc): remove this once nacl_io implements setuid and friends */ | 64 +/* TODO(sbc): remove this once nacl_io implements setuid and friends */ |
| 75 +#if !(defined(__native_client__) && defined(_NEWLIB_VERSION)) | 65 +#if !(defined(__native_client__) && defined(_NEWLIB_VERSION)) |
| 76 if (setgid (user_gid) < 0) | 66 if (setgid (user_gid) < 0) |
| 77 pfatal_with_name ("user_access: setgid"); | 67 pfatal_with_name ("user_access: setgid"); |
| 78 +#endif | 68 +#endif |
| 79 #else | 69 #else |
| 80 if (setregid (make_gid, user_gid) < 0) | 70 if (setregid (make_gid, user_gid) < 0) |
| 81 pfatal_with_name ("user_access: setregid"); | 71 pfatal_with_name ("user_access: setregid"); |
| OLD | NEW |