| OLD | NEW |
| 1 diff --git a/Makefile b/Makefile | 1 diff --git a/Makefile b/Makefile |
| 2 --- a/Makefile | 2 --- a/Makefile |
| 3 +++ b/Makefile | 3 +++ b/Makefile |
| 4 @@ -898,14 +898,22 @@ BUILTIN_OBJS += builtin/verify-tag.o | 4 @@ -898,14 +898,22 @@ BUILTIN_OBJS += builtin/verify-tag.o |
| 5 BUILTIN_OBJS += builtin/write-tree.o | 5 BUILTIN_OBJS += builtin/write-tree.o |
| 6 | 6 |
| 7 GITLIBS = $(LIB_FILE) $(XDIFF_LIB) | 7 GITLIBS = $(LIB_FILE) $(XDIFF_LIB) |
| 8 -EXTLIBS = | 8 -EXTLIBS = |
| 9 +EXTLIBS ?= | 9 +EXTLIBS ?= |
| 10 | 10 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 cp "$$execdir/git$X" "$$execdir/$$p" || exit; \ | 121 cp "$$execdir/git$X" "$$execdir/$$p" || exit; \ |
| 122 done && \ | 122 done && \ |
| 123 @@ -2279,7 +2285,6 @@ endif | 123 @@ -2279,7 +2285,6 @@ endif |
| 124 for p in $$remote_curl_aliases; do \ | 124 for p in $$remote_curl_aliases; do \ |
| 125 $(RM) "$$execdir/$$p" && \ | 125 $(RM) "$$execdir/$$p" && \ |
| 126 test -z "$(NO_INSTALL_HARDLINKS)" && \ | 126 test -z "$(NO_INSTALL_HARDLINKS)" && \ |
| 127 - ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null ||
\ | 127 - ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null ||
\ |
| 128 ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \ | 128 ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \ |
| 129 cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \ | 129 cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \ |
| 130 done && \ | 130 done && \ |
| 131 diff --git a/base85.c b/base85.c | |
| 132 --- a/base85.c | |
| 133 +++ b/base85.c | |
| 134 @@ -102,7 +102,11 @@ void encode_85(char *buf, const unsigned char *data, int by
tes) | |
| 135 } | |
| 136 | |
| 137 #ifdef DEBUG_85 | |
| 138 +#if defined(__native_client__) | |
| 139 +int nacl_main(int ac, char *av[]) | |
| 140 +#else | |
| 141 int main(int ac, char **av) | |
| 142 +#endif | |
| 143 { | |
| 144 char buf[1024]; | |
| 145 | |
| 146 diff --git a/builtin/log.c b/builtin/log.c | 131 diff --git a/builtin/log.c b/builtin/log.c |
| 147 --- a/builtin/log.c | 132 --- a/builtin/log.c |
| 148 +++ b/builtin/log.c | 133 +++ b/builtin/log.c |
| 149 @@ -229,7 +229,9 @@ static void show_early_header(struct rev_info *rev, const ch
ar *stage, int nr) | 134 @@ -229,7 +229,9 @@ static void show_early_header(struct rev_info *rev, const ch
ar *stage, int nr) |
| 150 printf(_("Final output: %d %s\n"), nr, stage); | 135 printf(_("Final output: %d %s\n"), nr, stage); |
| 151 } | 136 } |
| 152 | 137 |
| 153 +#if !defined(__native_client__) || defined(__GLIBC__) | 138 +#if !defined(__native_client__) || defined(__GLIBC__) |
| 154 static struct itimerval early_output_timer; | 139 static struct itimerval early_output_timer; |
| 155 +#endif | 140 +#endif |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 */ | 175 */ |
| 191 +#if !defined(__native_client__) || defined(__GLIBC__) | 176 +#if !defined(__native_client__) || defined(__GLIBC__) |
| 192 + /* TODO(bradnelson): Turn this back on once nacl_io supports it. */ | 177 + /* TODO(bradnelson): Turn this back on once nacl_io supports it. */ |
| 193 early_output_timer.it_value.tv_sec = 0; | 178 early_output_timer.it_value.tv_sec = 0; |
| 194 early_output_timer.it_value.tv_usec = 100000; | 179 early_output_timer.it_value.tv_usec = 100000; |
| 195 setitimer(ITIMER_REAL, &early_output_timer, NULL); | 180 setitimer(ITIMER_REAL, &early_output_timer, NULL); |
| 196 +#endif | 181 +#endif |
| 197 } | 182 } |
| 198 | 183 |
| 199 static void finish_early_output(struct rev_info *rev) | 184 static void finish_early_output(struct rev_info *rev) |
| 200 diff --git a/check-racy.c b/check-racy.c | |
| 201 --- a/check-racy.c | |
| 202 +++ b/check-racy.c | |
| 203 @@ -1,6 +1,10 @@ | |
| 204 #include "cache.h" | |
| 205 | |
| 206 +#if defined(__native_client__) | |
| 207 +int nacl_main(int ac, char *av[]) | |
| 208 +#else | |
| 209 int main(int ac, char **av) | |
| 210 +#endif | |
| 211 { | |
| 212 int i; | |
| 213 int dirty, clean, racy; | |
| 214 diff --git a/compat/nacl.c b/compat/nacl.c | 185 diff --git a/compat/nacl.c b/compat/nacl.c |
| 215 new file mode 100644 | 186 new file mode 100644 |
| 216 --- /dev/null | 187 --- /dev/null |
| 217 +++ b/compat/nacl.c | 188 +++ b/compat/nacl.c |
| 218 @@ -0,0 +1,73 @@ | 189 @@ -0,0 +1,73 @@ |
| 219 +static char **copy_environ(void) | 190 +static char **copy_environ(void) |
| 220 +{ | 191 +{ |
| 221 + char **env; | 192 + char **env; |
| 222 + int i = 0; | 193 + int i = 0; |
| 223 + while (environ[i]) | 194 + while (environ[i]) |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 @@ -878,7 +882,8 @@ AC_RUN_IFELSE( | 305 @@ -878,7 +882,8 @@ AC_RUN_IFELSE( |
| 335 if (snprintf(buf, 3, "%s", "12345") != 5 | 306 if (snprintf(buf, 3, "%s", "12345") != 5 |
| 336 || strcmp(buf, "12")) return 1]])], | 307 || strcmp(buf, "12")) return 1]])], |
| 337 [ac_cv_snprintf_returns_bogus=no], | 308 [ac_cv_snprintf_returns_bogus=no], |
| 338 - [ac_cv_snprintf_returns_bogus=yes]) | 309 - [ac_cv_snprintf_returns_bogus=yes]) |
| 339 + [ac_cv_snprintf_returns_bogus=yes], | 310 + [ac_cv_snprintf_returns_bogus=yes], |
| 340 + [ac_cv_snprintf_returns_bogus=no]) | 311 + [ac_cv_snprintf_returns_bogus=no]) |
| 341 ]) | 312 ]) |
| 342 if test $ac_cv_snprintf_returns_bogus = yes; then | 313 if test $ac_cv_snprintf_returns_bogus = yes; then |
| 343 SNPRINTF_RETURNS_BOGUS=UnfortunatelyYes | 314 SNPRINTF_RETURNS_BOGUS=UnfortunatelyYes |
| 344 diff --git a/credential-cache--daemon.c b/credential-cache--daemon.c | |
| 345 --- a/credential-cache--daemon.c | |
| 346 +++ b/credential-cache--daemon.c | |
| 347 @@ -255,6 +255,10 @@ static void check_socket_directory(const char *path) | |
| 348 free(path_copy); | |
| 349 } | |
| 350 | |
| 351 +#if defined(__native_client__) | |
| 352 +#define main nacl_main | |
| 353 +#endif | |
| 354 + | |
| 355 int main(int argc, const char **argv) | |
| 356 { | |
| 357 static const char *usage[] = { | |
| 358 diff --git a/credential-cache.c b/credential-cache.c | |
| 359 --- a/credential-cache.c | |
| 360 +++ b/credential-cache.c | |
| 361 @@ -82,6 +82,10 @@ static void do_cache(const char *socket, const char *action,
int timeout, | |
| 362 strbuf_release(&buf); | |
| 363 } | |
| 364 | |
| 365 +#if defined(__native_client__) | |
| 366 +#define main nacl_main | |
| 367 +#endif | |
| 368 + | |
| 369 int main(int argc, const char **argv) | |
| 370 { | |
| 371 char *socket_path = NULL; | |
| 372 diff --git a/credential-store.c b/credential-store.c | |
| 373 --- a/credential-store.c | |
| 374 +++ b/credential-store.c | |
| 375 @@ -115,6 +115,10 @@ static int lookup_credential(const char *fn, struct credent
ial *c) | |
| 376 return c->username && c->password; | |
| 377 } | |
| 378 | |
| 379 +#ifdef __native_client__ | |
| 380 +#define main nacl_main | |
| 381 +#endif | |
| 382 + | |
| 383 int main(int argc, char **argv) | |
| 384 { | |
| 385 const char * const usage[] = { | |
| 386 diff --git a/daemon.c b/daemon.c | 315 diff --git a/daemon.c b/daemon.c |
| 387 --- a/daemon.c | 316 --- a/daemon.c |
| 388 +++ b/daemon.c | 317 +++ b/daemon.c |
| 389 @@ -66,7 +66,9 @@ static void logreport(int priority, const char *err, va_list p
arams) | 318 @@ -66,7 +66,9 @@ static void logreport(int priority, const char *err, va_list p
arams) |
| 390 if (log_syslog) { | 319 if (log_syslog) { |
| 391 char buf[1024]; | 320 char buf[1024]; |
| 392 vsnprintf(buf, sizeof(buf), err, params); | 321 vsnprintf(buf, sizeof(buf), err, params); |
| 393 +#if !defined(__native_client__) || defined(__GLIBC__) | 322 +#if !defined(__native_client__) || defined(__GLIBC__) |
| 394 syslog(priority, "%s", buf); | 323 syslog(priority, "%s", buf); |
| 395 +#endif | 324 +#endif |
| 396 } else { | 325 } else { |
| 397 /* | 326 /* |
| 398 * Since stderr is set to buffered mode, the | 327 * Since stderr is set to buffered mode, the |
| 399 @@ -1096,7 +1098,11 @@ static int serve(struct string_list *listen_addr, int lis
ten_port, | |
| 400 return service_loop(&socklist); | |
| 401 } | |
| 402 | |
| 403 +#if defined(__native_client__) | |
| 404 +int nacl_main(int argc, char *argv[]) | |
| 405 +#else | |
| 406 int main(int argc, char **argv) | |
| 407 +#endif | |
| 408 { | |
| 409 int listen_port = 0; | |
| 410 struct string_list listen_addr = STRING_LIST_INIT_NODUP; | |
| 411 @@ -1247,7 +1253,9 @@ int main(int argc, char **argv) | 328 @@ -1247,7 +1253,9 @@ int main(int argc, char **argv) |
| 412 } | 329 } |
| 413 | 330 |
| 414 if (log_syslog) { | 331 if (log_syslog) { |
| 415 +#if !defined(__native_client__) || defined(__GLIBC__) | 332 +#if !defined(__native_client__) || defined(__GLIBC__) |
| 416 openlog("git-daemon", LOG_PID, LOG_DAEMON); | 333 openlog("git-daemon", LOG_PID, LOG_DAEMON); |
| 417 +#endif | 334 +#endif |
| 418 set_die_routine(daemon_die); | 335 set_die_routine(daemon_die); |
| 419 } else | 336 } else |
| 420 /* avoid splitting a message in the middle */ | 337 /* avoid splitting a message in the middle */ |
| (...skipping 10 matching lines...) Expand all Loading... |
| 431 | 348 |
| 432 memset(&sa, 0, sizeof(sa)); | 349 memset(&sa, 0, sizeof(sa)); |
| 433 @@ -534,6 +536,7 @@ static void set_checkpoint_signal(void) | 350 @@ -534,6 +536,7 @@ static void set_checkpoint_signal(void) |
| 434 sigemptyset(&sa.sa_mask); | 351 sigemptyset(&sa.sa_mask); |
| 435 sa.sa_flags = SA_RESTART; | 352 sa.sa_flags = SA_RESTART; |
| 436 sigaction(SIGUSR1, &sa, NULL); | 353 sigaction(SIGUSR1, &sa, NULL); |
| 437 +#endif | 354 +#endif |
| 438 } | 355 } |
| 439 | 356 |
| 440 #endif | 357 #endif |
| 441 @@ -3350,6 +3353,10 @@ static void parse_argv(void) | |
| 442 read_marks(); | |
| 443 } | |
| 444 | |
| 445 +#ifdef __native_client__ | |
| 446 +#define main nacl_main | |
| 447 +#endif | |
| 448 + | |
| 449 int main(int argc, char **argv) | |
| 450 { | |
| 451 unsigned int i; | |
| 452 diff --git a/fetch-pack.c b/fetch-pack.c | 358 diff --git a/fetch-pack.c b/fetch-pack.c |
| 453 --- a/fetch-pack.c | 359 --- a/fetch-pack.c |
| 454 +++ b/fetch-pack.c | 360 +++ b/fetch-pack.c |
| 455 @@ -649,11 +649,23 @@ static int everything_local(struct fetch_pack_args *args, | 361 @@ -649,11 +649,23 @@ static int everything_local(struct fetch_pack_args *args, |
| 456 return retval; | 362 return retval; |
| 457 } | 363 } |
| 458 | 364 |
| 459 +/* | 365 +/* |
| 460 + * TODO(bradnelson): Remove when corruption figured out. | 366 + * TODO(bradnelson): Remove when corruption figured out. |
| 461 + * Adding synchronization to backgroun demuxer. | 367 + * Adding synchronization to backgroun demuxer. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 | 426 |
| 521 +#if defined(__native_client__) && !defined(__GLIBC__) | 427 +#if defined(__native_client__) && !defined(__GLIBC__) |
| 522 +#define gethostname(dst, len) strcpy(dst, "localhost") | 428 +#define gethostname(dst, len) strcpy(dst, "localhost") |
| 523 +#define getservbyname(dst, len) 0 | 429 +#define getservbyname(dst, len) 0 |
| 524 +#define setsid(n) 0 | 430 +#define setsid(n) 0 |
| 525 +#define alarm(n) 0 | 431 +#define alarm(n) 0 |
| 526 +#define getgrnam(n) 0 | 432 +#define getgrnam(n) 0 |
| 527 +#endif | 433 +#endif |
| 528 + | 434 + |
| 529 #endif | 435 #endif |
| 530 diff --git a/git.c b/git.c | |
| 531 --- a/git.c | |
| 532 +++ b/git.c | |
| 533 @@ -614,6 +614,10 @@ static void restore_sigpipe_to_default(void) | |
| 534 signal(SIGPIPE, SIG_DFL); | |
| 535 } | |
| 536 | |
| 537 +#ifdef __native_client__ | |
| 538 +#define main nacl_main | |
| 539 +#endif | |
| 540 + | |
| 541 int main(int argc, char **av) | |
| 542 { | |
| 543 const char **argv = (const char **) av; | |
| 544 diff --git a/http-backend.c b/http-backend.c | |
| 545 --- a/http-backend.c | |
| 546 +++ b/http-backend.c | |
| 547 @@ -557,7 +557,11 @@ static struct service_cmd { | |
| 548 {"POST", "/git-receive-pack$", service_rpc} | |
| 549 }; | |
| 550 | |
| 551 +#if defined(__native_client__) | |
| 552 +int nacl_main(int argc, char *argv[]) | |
| 553 +#else | |
| 554 int main(int argc, char **argv) | |
| 555 +#endif | |
| 556 { | |
| 557 char *method = getenv("REQUEST_METHOD"); | |
| 558 char *dir; | |
| 559 diff --git a/http-fetch.c b/http-fetch.c | |
| 560 --- a/http-fetch.c | |
| 561 +++ b/http-fetch.c | |
| 562 @@ -6,6 +6,10 @@ | |
| 563 static const char http_fetch_usage[] = "git http-fetch " | |
| 564 "[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url"; | |
| 565 | |
| 566 +#if defined(__native_client__) | |
| 567 +#define main nacl_main | |
| 568 +#endif | |
| 569 + | |
| 570 int main(int argc, const char **argv) | |
| 571 { | |
| 572 struct walker *walker; | |
| 573 diff --git a/http-push.c b/http-push.c | |
| 574 --- a/http-push.c | |
| 575 +++ b/http-push.c | |
| 576 @@ -1713,7 +1713,11 @@ static void run_request_queue(void) | |
| 577 #endif | |
| 578 } | |
| 579 | |
| 580 +#if defined(__native_client__) | |
| 581 +int nacl_main(int argc, char *argv[]) | |
| 582 +#else | |
| 583 int main(int argc, char **argv) | |
| 584 +#endif | |
| 585 { | |
| 586 struct transfer_request *request; | |
| 587 struct transfer_request *next_request; | |
| 588 diff --git a/imap-send.c b/imap-send.c | |
| 589 --- a/imap-send.c | |
| 590 +++ b/imap-send.c | |
| 591 @@ -1484,7 +1484,11 @@ static int curl_append_msgs_to_imap(struct imap_server_co
nf *server, | |
| 592 } | |
| 593 #endif | |
| 594 | |
| 595 +#if defined(__native_client__) | |
| 596 +int nacl_main(int argc, char *argv[]) | |
| 597 +#else | |
| 598 int main(int argc, char **argv) | |
| 599 +#endif | |
| 600 { | |
| 601 struct strbuf all_msgs = STRBUF_INIT; | |
| 602 int total; | |
| 603 diff --git a/progress.c b/progress.c | 436 diff --git a/progress.c b/progress.c |
| 604 --- a/progress.c | 437 --- a/progress.c |
| 605 +++ b/progress.c | 438 +++ b/progress.c |
| 606 @@ -47,6 +47,8 @@ static void progress_interval(int signum) | 439 @@ -47,6 +47,8 @@ static void progress_interval(int signum) |
| 607 | 440 |
| 608 static void set_progress_signal(void) | 441 static void set_progress_signal(void) |
| 609 { | 442 { |
| 610 +#if !defined(__native_client__) || defined(__GLIBC__) | 443 +#if !defined(__native_client__) || defined(__GLIBC__) |
| 611 + /* TODO(bradnelson): Renable when nacl_io can do this. */ | 444 + /* TODO(bradnelson): Renable when nacl_io can do this. */ |
| 612 struct sigaction sa; | 445 struct sigaction sa; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 624 +#if !defined(__native_client__) || defined(__GLIBC__) | 457 +#if !defined(__native_client__) || defined(__GLIBC__) |
| 625 + /* TODO(bradnelson): Renable when nacl_io can do this. */ | 458 + /* TODO(bradnelson): Renable when nacl_io can do this. */ |
| 626 struct itimerval v = {{0,},}; | 459 struct itimerval v = {{0,},}; |
| 627 setitimer(ITIMER_REAL, &v, NULL); | 460 setitimer(ITIMER_REAL, &v, NULL); |
| 628 signal(SIGALRM, SIG_IGN); | 461 signal(SIGALRM, SIG_IGN); |
| 629 progress_update = 0; | 462 progress_update = 0; |
| 630 +#endif | 463 +#endif |
| 631 } | 464 } |
| 632 | 465 |
| 633 static int display(struct progress *progress, unsigned n, const char *done) | 466 static int display(struct progress *progress, unsigned n, const char *done) |
| 634 diff --git a/remote-curl.c b/remote-curl.c | |
| 635 --- a/remote-curl.c | |
| 636 +++ b/remote-curl.c | |
| 637 @@ -957,7 +957,11 @@ static void parse_push(struct strbuf *buf) | |
| 638 free(specs); | |
| 639 } | |
| 640 | |
| 641 +#if defined(__native_client__) | |
| 642 +int nacl_main(int argc, char *argv[]) | |
| 643 +#else | |
| 644 int main(int argc, const char **argv) | |
| 645 +#endif | |
| 646 { | |
| 647 struct strbuf buf = STRBUF_INIT; | |
| 648 int nongit; | |
| 649 diff --git a/remote-testsvn.c b/remote-testsvn.c | |
| 650 --- a/remote-testsvn.c | |
| 651 +++ b/remote-testsvn.c | |
| 652 @@ -283,6 +283,10 @@ static int do_command(struct strbuf *line) | |
| 653 return 0; | |
| 654 } | |
| 655 | |
| 656 +#ifdef __native_client__ | |
| 657 +#define main nacl_main | |
| 658 +#endif | |
| 659 + | |
| 660 int main(int argc, char **argv) | |
| 661 { | |
| 662 struct strbuf buf = STRBUF_INIT, url_sb = STRBUF_INIT, | |
| 663 diff --git a/run-command.c b/run-command.c | 467 diff --git a/run-command.c b/run-command.c |
| 664 --- a/run-command.c | 468 --- a/run-command.c |
| 665 +++ b/run-command.c | 469 +++ b/run-command.c |
| 666 @@ -4,6 +4,11 @@ | 470 @@ -4,6 +4,11 @@ |
| 667 #include "sigchain.h" | 471 #include "sigchain.h" |
| 668 #include "argv-array.h" | 472 #include "argv-array.h" |
| 669 | 473 |
| 670 +#if defined(__native_client__) | 474 +#if defined(__native_client__) |
| 671 +# include <spawn.h> | 475 +# include <spawn.h> |
| 672 +# include "compat/nacl.c" | 476 +# include "compat/nacl.c" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 proc_out = async->out; | 615 proc_out = async->out; |
| 812 else | 616 else |
| 813 @@ -751,7 +818,6 @@ int start_async(struct async *async) | 617 @@ -751,7 +818,6 @@ int start_async(struct async *async) |
| 814 set_die_routine(die_async); | 618 set_die_routine(die_async); |
| 815 set_die_is_recursing_routine(async_die_is_recursing); | 619 set_die_is_recursing_routine(async_die_is_recursing); |
| 816 } | 620 } |
| 817 - | 621 - |
| 818 if (proc_in >= 0) | 622 if (proc_in >= 0) |
| 819 set_cloexec(proc_in); | 623 set_cloexec(proc_in); |
| 820 if (proc_out >= 0) | 624 if (proc_out >= 0) |
| 821 diff --git a/sh-i18n--envsubst.c b/sh-i18n--envsubst.c | |
| 822 --- a/sh-i18n--envsubst.c | |
| 823 +++ b/sh-i18n--envsubst.c | |
| 824 @@ -63,8 +63,12 @@ static void print_variables (const char *string); | |
| 825 static void note_variables (const char *string); | |
| 826 static void subst_from_stdin (void); | |
| 827 | |
| 828 +#if defined(__native_client__) | |
| 829 +int nacl_main(int argc, char *argv[]) | |
| 830 +#else | |
| 831 int | |
| 832 main (int argc, char *argv[]) | |
| 833 +#endif | |
| 834 { | |
| 835 /* Default values for command line options. */ | |
| 836 /* unsigned short int show_variables = 0; */ | |
| 837 diff --git a/sha1_file.c b/sha1_file.c | 625 diff --git a/sha1_file.c b/sha1_file.c |
| 838 --- a/sha1_file.c | 626 --- a/sha1_file.c |
| 839 +++ b/sha1_file.c | 627 +++ b/sha1_file.c |
| 840 @@ -872,6 +872,9 @@ void free_pack_by_name(const char *pack_name) | 628 @@ -872,6 +872,9 @@ void free_pack_by_name(const char *pack_name) |
| 841 | 629 |
| 842 static unsigned int get_max_fd_limit(void) | 630 static unsigned int get_max_fd_limit(void) |
| 843 { | 631 { |
| 844 +#if defined(__native_client__) | 632 +#if defined(__native_client__) |
| 845 + return 100; | 633 + return 100; |
| 846 +#endif | 634 +#endif |
| 847 #ifdef RLIMIT_NOFILE | 635 #ifdef RLIMIT_NOFILE |
| 848 { | 636 { |
| 849 struct rlimit lim; | 637 struct rlimit lim; |
| 850 diff --git a/shell.c b/shell.c | |
| 851 --- a/shell.c | |
| 852 +++ b/shell.c | |
| 853 @@ -138,7 +138,11 @@ static struct commands { | |
| 854 { NULL }, | |
| 855 }; | |
| 856 | |
| 857 +#if defined(__native_client__) | |
| 858 +int nacl_main(int argc, char *argv[]) | |
| 859 +#else | |
| 860 int main(int argc, char **argv) | |
| 861 +#endif | |
| 862 { | |
| 863 char *prog; | |
| 864 const char **user_argv; | |
| 865 diff --git a/show-index.c b/show-index.c | |
| 866 --- a/show-index.c | |
| 867 +++ b/show-index.c | |
| 868 @@ -4,7 +4,11 @@ | |
| 869 static const char show_index_usage[] = | |
| 870 "git show-index < <packed archive index>"; | |
| 871 | |
| 872 -int main(int argc, char **argv) | |
| 873 +#if defined(__native_client__) | |
| 874 +int nacl_main(int argc, char *argv[]) | |
| 875 +#else | |
| 876 +int main(int argc, const char **argv) | |
| 877 +#endif | |
| 878 { | |
| 879 int i; | |
| 880 unsigned nr; | |
| 881 diff --git a/test-chmtime.c b/test-chmtime.c | |
| 882 --- a/test-chmtime.c | |
| 883 +++ b/test-chmtime.c | |
| 884 @@ -56,6 +56,10 @@ static int timespec_arg(const char *arg, long int *set_time,
int *set_eq) | |
| 885 return 1; | |
| 886 } | |
| 887 | |
| 888 +#ifdef __native_client__ | |
| 889 +#define main nacl_main | |
| 890 +#endif | |
| 891 + | |
| 892 int main(int argc, char *argv[]) | |
| 893 { | |
| 894 static int verbose; | |
| 895 diff --git a/test-config.c b/test-config.c | |
| 896 --- a/test-config.c | |
| 897 +++ b/test-config.c | |
| 898 @@ -32,6 +32,9 @@ | |
| 899 * | |
| 900 */ | |
| 901 | |
| 902 +#ifdef __native_client__ | |
| 903 +#define main nacl_main | |
| 904 +#endif | |
| 905 | |
| 906 int main(int argc, char **argv) | |
| 907 { | |
| 908 diff --git a/test-ctype.c b/test-ctype.c | |
| 909 --- a/test-ctype.c | |
| 910 +++ b/test-ctype.c | |
| 911 @@ -28,7 +28,11 @@ static int is_in(const char *s, int ch) | |
| 912 #define LOWER "abcdefghijklmnopqrstuvwxyz" | |
| 913 #define UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
| 914 | |
| 915 +#if defined(__native_client__) | |
| 916 +int nacl_main(int argc, char *argv[]) | |
| 917 +#else | |
| 918 int main(int argc, char **argv) | |
| 919 +#endif | |
| 920 { | |
| 921 TEST_CLASS(isdigit, DIGIT); | |
| 922 TEST_CLASS(isspace, " \n\r\t"); | |
| 923 diff --git a/test-date.c b/test-date.c | |
| 924 --- a/test-date.c | |
| 925 +++ b/test-date.c | |
| 926 @@ -45,7 +45,11 @@ static void parse_approxidate(char **argv, struct timeval *no
w) | |
| 927 } | |
| 928 } | |
| 929 | |
| 930 +#if defined(__native_client__) | |
| 931 +int nacl_main(int argc, char *argv[]) | |
| 932 +#else | |
| 933 int main(int argc, char **argv) | |
| 934 +#endif | |
| 935 { | |
| 936 struct timeval now; | |
| 937 const char *x; | |
| 938 diff --git a/test-delta.c b/test-delta.c | |
| 939 --- a/test-delta.c | |
| 940 +++ b/test-delta.c | |
| 941 @@ -15,7 +15,11 @@ | |
| 942 static const char usage_str[] = | |
| 943 "test-delta (-d|-p) <from_file> <data_file> <out_file>"; | |
| 944 | |
| 945 +#if defined(__native_client__) | |
| 946 +int nacl_main(int argc, char *argv[]) | |
| 947 +#else | |
| 948 int main(int argc, char *argv[]) | |
| 949 +#endif | |
| 950 { | |
| 951 int fd; | |
| 952 struct stat st; | |
| 953 diff --git a/test-dump-cache-tree.c b/test-dump-cache-tree.c | |
| 954 --- a/test-dump-cache-tree.c | |
| 955 +++ b/test-dump-cache-tree.c | |
| 956 @@ -54,7 +54,11 @@ static int dump_cache_tree(struct cache_tree *it, | |
| 957 return errs; | |
| 958 } | |
| 959 | |
| 960 +#if defined(__native_client__) | |
| 961 +int nacl_main(int ac, char *av[]) | |
| 962 +#else | |
| 963 int main(int ac, char **av) | |
| 964 +#endif | |
| 965 { | |
| 966 struct index_state istate; | |
| 967 struct cache_tree *another = cache_tree(); | |
| 968 diff --git a/test-dump-split-index.c b/test-dump-split-index.c | |
| 969 --- a/test-dump-split-index.c | |
| 970 +++ b/test-dump-split-index.c | |
| 971 @@ -7,6 +7,10 @@ static void show_bit(size_t pos, void *data) | |
| 972 printf(" %d", (int)pos); | |
| 973 } | |
| 974 | |
| 975 +#ifdef __native_client__ | |
| 976 +#define main nacl_main | |
| 977 +#endif | |
| 978 + | |
| 979 int main(int ac, char **av) | |
| 980 { | |
| 981 struct split_index *si; | |
| 982 diff --git a/test-genrandom.c b/test-genrandom.c | |
| 983 --- a/test-genrandom.c | |
| 984 +++ b/test-genrandom.c | |
| 985 @@ -6,7 +6,11 @@ | |
| 986 | |
| 987 #include "git-compat-util.h" | |
| 988 | |
| 989 +#if defined(__native_client__) | |
| 990 +int nacl_main(int argc, char *argv[]) | |
| 991 +#else | |
| 992 int main(int argc, char *argv[]) | |
| 993 +#endif | |
| 994 { | |
| 995 unsigned long count, next = 0; | |
| 996 unsigned char *c; | |
| 997 diff --git a/test-hashmap.c b/test-hashmap.c | |
| 998 --- a/test-hashmap.c | |
| 999 +++ b/test-hashmap.c | |
| 1000 @@ -126,6 +126,10 @@ static void perf_hashmap(unsigned int method, unsigned int
rounds) | |
| 1001 | |
| 1002 #define DELIM " \t\r\n" | |
| 1003 | |
| 1004 +#ifdef __native_client__ | |
| 1005 +#define main nacl_main | |
| 1006 +#endif | |
| 1007 + | |
| 1008 /* | |
| 1009 * Read stdin line by line and print result of commands to stdout: | |
| 1010 * | |
| 1011 diff --git a/test-index-version.c b/test-index-version.c | |
| 1012 --- a/test-index-version.c | |
| 1013 +++ b/test-index-version.c | |
| 1014 @@ -1,5 +1,9 @@ | |
| 1015 #include "cache.h" | |
| 1016 | |
| 1017 +#ifdef __native_client__ | |
| 1018 +#define main nacl_main | |
| 1019 +#endif | |
| 1020 + | |
| 1021 int main(int argc, char **argv) | |
| 1022 { | |
| 1023 struct cache_header hdr; | |
| 1024 diff --git a/test-line-buffer.c b/test-line-buffer.c | |
| 1025 --- a/test-line-buffer.c | |
| 1026 +++ b/test-line-buffer.c | |
| 1027 @@ -50,7 +50,11 @@ static void handle_line(const char *line, struct line_buffer
*stdin_buf) | |
| 1028 handle_command(line, arg + 1, stdin_buf); | |
| 1029 } | |
| 1030 | |
| 1031 +#if defined(__native_client__) | |
| 1032 +int nacl_main(int argc, char *argv[]) | |
| 1033 +#else | |
| 1034 int main(int argc, char *argv[]) | |
| 1035 +#endif | |
| 1036 { | |
| 1037 struct line_buffer stdin_buf = LINE_BUFFER_INIT; | |
| 1038 struct line_buffer file_buf = LINE_BUFFER_INIT; | |
| 1039 diff --git a/test-match-trees.c b/test-match-trees.c | |
| 1040 --- a/test-match-trees.c | |
| 1041 +++ b/test-match-trees.c | |
| 1042 @@ -1,7 +1,11 @@ | |
| 1043 #include "cache.h" | |
| 1044 #include "tree.h" | |
| 1045 | |
| 1046 +#if defined(__native_client__) | |
| 1047 +int nacl_main(int ac, char *av[]) | |
| 1048 +#else | |
| 1049 int main(int ac, char **av) | |
| 1050 +#endif | |
| 1051 { | |
| 1052 unsigned char hash1[20], hash2[20], shifted[20]; | |
| 1053 struct tree *one, *two; | |
| 1054 diff --git a/test-mergesort.c b/test-mergesort.c | |
| 1055 --- a/test-mergesort.c | |
| 1056 +++ b/test-mergesort.c | |
| 1057 @@ -22,6 +22,10 @@ static int compare_strings(const void *a, const void *b) | |
| 1058 return strcmp(x->text, y->text); | |
| 1059 } | |
| 1060 | |
| 1061 +#ifdef __native_client__ | |
| 1062 +#define main nacl_main | |
| 1063 +#endif | |
| 1064 + | |
| 1065 int main(int argc, char **argv) | |
| 1066 { | |
| 1067 struct line *line, *p = NULL, *lines = NULL; | |
| 1068 diff --git a/test-mktemp.c b/test-mktemp.c | |
| 1069 --- a/test-mktemp.c | |
| 1070 +++ b/test-mktemp.c | |
| 1071 @@ -3,7 +3,11 @@ | |
| 1072 */ | |
| 1073 #include "git-compat-util.h" | |
| 1074 | |
| 1075 +#if defined(__native_client__) | |
| 1076 +int nacl_main(int argc, char *argv[]) | |
| 1077 +#else | |
| 1078 int main(int argc, char *argv[]) | |
| 1079 +#endif | |
| 1080 { | |
| 1081 if (argc != 2) | |
| 1082 usage("Expected 1 parameter defining the temporary file template
"); | |
| 1083 diff --git a/test-parse-options.c b/test-parse-options.c | |
| 1084 --- a/test-parse-options.c | |
| 1085 +++ b/test-parse-options.c | |
| 1086 @@ -29,6 +29,10 @@ static int number_callback(const struct option *opt, const ch
ar *arg, int unset) | |
| 1087 return 0; | |
| 1088 } | |
| 1089 | |
| 1090 +#ifdef __native_client__ | |
| 1091 +#define main nacl_main | |
| 1092 +#endif | |
| 1093 + | |
| 1094 int main(int argc, char **argv) | |
| 1095 { | |
| 1096 const char *prefix = "prefix/"; | |
| 1097 diff --git a/test-path-utils.c b/test-path-utils.c | |
| 1098 --- a/test-path-utils.c | |
| 1099 +++ b/test-path-utils.c | |
| 1100 @@ -41,7 +41,11 @@ static void normalize_argv_string(const char **var, const cha
r *input) | |
| 1101 die("Bad value: %s\n", input); | |
| 1102 } | |
| 1103 | |
| 1104 +#if defined(__native_client__) | |
| 1105 +int nacl_main(int argc, char *argv[]) | |
| 1106 +#else | |
| 1107 int main(int argc, char **argv) | |
| 1108 +#endif | |
| 1109 { | |
| 1110 if (argc == 3 && !strcmp(argv[1], "normalize_path_copy")) { | |
| 1111 char *buf = xmalloc(PATH_MAX + 1); | |
| 1112 diff --git a/test-prio-queue.c b/test-prio-queue.c | |
| 1113 --- a/test-prio-queue.c | |
| 1114 +++ b/test-prio-queue.c | |
| 1115 @@ -16,6 +16,10 @@ static void show(int *v) | |
| 1116 free(v); | |
| 1117 } | |
| 1118 | |
| 1119 +#ifdef __native_client__ | |
| 1120 +#define main nacl_main | |
| 1121 +#endif | |
| 1122 + | |
| 1123 int main(int argc, char **argv) | |
| 1124 { | |
| 1125 struct prio_queue pq = { intcmp }; | |
| 1126 diff --git a/test-read-cache.c b/test-read-cache.c | |
| 1127 --- a/test-read-cache.c | |
| 1128 +++ b/test-read-cache.c | |
| 1129 @@ -1,5 +1,9 @@ | |
| 1130 #include "cache.h" | |
| 1131 | |
| 1132 +#ifdef __native_client__ | |
| 1133 +#define main nacl_main | |
| 1134 +#endif | |
| 1135 + | |
| 1136 int main (int argc, char **argv) | |
| 1137 { | |
| 1138 int i, cnt = 1; | |
| 1139 diff --git a/test-regex.c b/test-regex.c | |
| 1140 --- a/test-regex.c | |
| 1141 +++ b/test-regex.c | |
| 1142 @@ -1,6 +1,10 @@ | |
| 1143 #include "git-compat-util.h" | |
| 1144 | |
| 1145 +#if defined(__native_client__) | |
| 1146 +int nacl_main(int argc, char *argv[]) | |
| 1147 +#else | |
| 1148 int main(int argc, char **argv) | |
| 1149 +#endif | |
| 1150 { | |
| 1151 char *pat = "[^={} \t]+"; | |
| 1152 char *str = "={}\nfred"; | |
| 1153 diff --git a/test-revision-walking.c b/test-revision-walking.c | |
| 1154 --- a/test-revision-walking.c | |
| 1155 +++ b/test-revision-walking.c | |
| 1156 @@ -45,7 +45,11 @@ static int run_revision_walk(void) | |
| 1157 return got_revision; | |
| 1158 } | |
| 1159 | |
| 1160 +#if defined(__native_client__) | |
| 1161 +int nacl_main(int argc, char *argv[]) | |
| 1162 +#else | |
| 1163 int main(int argc, char **argv) | |
| 1164 +#endif | |
| 1165 { | |
| 1166 if (argc < 2) | |
| 1167 return 1; | |
| 1168 diff --git a/test-run-command.c b/test-run-command.c | |
| 1169 --- a/test-run-command.c | |
| 1170 +++ b/test-run-command.c | |
| 1171 @@ -13,7 +13,11 @@ | |
| 1172 #include <string.h> | |
| 1173 #include <errno.h> | |
| 1174 | |
| 1175 +#if defined(__native_client__) | |
| 1176 +int nacl_main(int argc, char *argv[]) | |
| 1177 +#else | |
| 1178 int main(int argc, char **argv) | |
| 1179 +#endif | |
| 1180 { | |
| 1181 struct child_process proc = CHILD_PROCESS_INIT; | |
| 1182 | |
| 1183 diff --git a/test-scrap-cache-tree.c b/test-scrap-cache-tree.c | |
| 1184 --- a/test-scrap-cache-tree.c | |
| 1185 +++ b/test-scrap-cache-tree.c | |
| 1186 @@ -5,7 +5,11 @@ | |
| 1187 | |
| 1188 static struct lock_file index_lock; | |
| 1189 | |
| 1190 -int main(int ac, char **av) | |
| 1191 +#if defined(__native_client__) | |
| 1192 +int nacl_main(int argc, char *argv[]) | |
| 1193 +#else | |
| 1194 +int main(int argc, char **argv) | |
| 1195 +#endif | |
| 1196 { | |
| 1197 hold_locked_index(&index_lock, 1); | |
| 1198 if (read_cache() < 0) | |
| 1199 diff --git a/test-sha1-array.c b/test-sha1-array.c | |
| 1200 --- a/test-sha1-array.c | |
| 1201 +++ b/test-sha1-array.c | |
| 1202 @@ -6,6 +6,10 @@ static void print_sha1(const unsigned char sha1[20], void *data
) | |
| 1203 puts(sha1_to_hex(sha1)); | |
| 1204 } | |
| 1205 | |
| 1206 +#ifdef __native_client__ | |
| 1207 +#define main nacl_main | |
| 1208 +#endif | |
| 1209 + | |
| 1210 int main(int argc, char **argv) | |
| 1211 { | |
| 1212 struct sha1_array array = SHA1_ARRAY_INIT; | |
| 1213 diff --git a/test-sha1.c b/test-sha1.c | |
| 1214 --- a/test-sha1.c | |
| 1215 +++ b/test-sha1.c | |
| 1216 @@ -1,6 +1,10 @@ | |
| 1217 #include "cache.h" | |
| 1218 | |
| 1219 +#if defined(__native_client__) | |
| 1220 +int nacl_main(int ac, char *av[]) | |
| 1221 +#else | |
| 1222 int main(int ac, char **av) | |
| 1223 +#endif | |
| 1224 { | |
| 1225 git_SHA_CTX ctx; | |
| 1226 unsigned char sha1[20]; | |
| 1227 diff --git a/test-sigchain.c b/test-sigchain.c | |
| 1228 --- a/test-sigchain.c | |
| 1229 +++ b/test-sigchain.c | |
| 1230 @@ -13,7 +13,11 @@ X(two) | |
| 1231 X(three) | |
| 1232 #undef X | |
| 1233 | |
| 1234 +#if defined(__native_client__) | |
| 1235 +int nacl_main(int argc, char *argv[]) { | |
| 1236 +#else | |
| 1237 int main(int argc, char **argv) { | |
| 1238 +#endif | |
| 1239 sigchain_push(SIGTERM, one); | |
| 1240 sigchain_push(SIGTERM, two); | |
| 1241 sigchain_push(SIGTERM, three); | |
| 1242 diff --git a/test-string-list.c b/test-string-list.c | |
| 1243 --- a/test-string-list.c | |
| 1244 +++ b/test-string-list.c | |
| 1245 @@ -41,7 +41,11 @@ static int prefix_cb(struct string_list_item *item, void *cb_
data) | |
| 1246 return starts_with(item->string, prefix); | |
| 1247 } | |
| 1248 | |
| 1249 +#if defined(__native_client__) | |
| 1250 +int nacl_main(int argc, char *argv[]) | |
| 1251 +#else | |
| 1252 int main(int argc, char **argv) | |
| 1253 +#endif | |
| 1254 { | |
| 1255 if (argc == 5 && !strcmp(argv[1], "split")) { | |
| 1256 struct string_list list = STRING_LIST_INIT_DUP; | |
| 1257 diff --git a/test-subprocess.c b/test-subprocess.c | |
| 1258 --- a/test-subprocess.c | |
| 1259 +++ b/test-subprocess.c | |
| 1260 @@ -1,6 +1,10 @@ | |
| 1261 #include "cache.h" | |
| 1262 #include "run-command.h" | |
| 1263 | |
| 1264 +#ifdef __native_client__ | |
| 1265 +#define main nacl_main | |
| 1266 +#endif | |
| 1267 + | |
| 1268 int main(int argc, char **argv) | |
| 1269 { | |
| 1270 struct child_process cp = CHILD_PROCESS_INIT; | |
| 1271 diff --git a/test-svn-fe.c b/test-svn-fe.c | |
| 1272 --- a/test-svn-fe.c | |
| 1273 +++ b/test-svn-fe.c | |
| 1274 @@ -35,7 +35,11 @@ static int apply_delta(int argc, char *argv[]) | |
| 1275 return 0; | |
| 1276 } | |
| 1277 | |
| 1278 +#if defined(__native_client__) | |
| 1279 +int nacl_main(int argc, char *argv[]) | |
| 1280 +#else | |
| 1281 int main(int argc, char *argv[]) | |
| 1282 +#endif | |
| 1283 { | |
| 1284 if (argc == 2) { | |
| 1285 if (svndump_init(argv[1])) | |
| 1286 diff --git a/test-urlmatch-normalization.c b/test-urlmatch-normalization.c | |
| 1287 --- a/test-urlmatch-normalization.c | |
| 1288 +++ b/test-urlmatch-normalization.c | |
| 1289 @@ -1,6 +1,10 @@ | |
| 1290 #include "git-compat-util.h" | |
| 1291 #include "urlmatch.h" | |
| 1292 | |
| 1293 +#ifdef __native_client__ | |
| 1294 +#define main nacl_main | |
| 1295 +#endif | |
| 1296 + | |
| 1297 int main(int argc, char **argv) | |
| 1298 { | |
| 1299 const char usage[] = "test-urlmatch-normalization [-p | -l] <url1> | <ur
l1> <url2>"; | |
| 1300 diff --git a/test-wildmatch.c b/test-wildmatch.c | |
| 1301 --- a/test-wildmatch.c | |
| 1302 +++ b/test-wildmatch.c | |
| 1303 @@ -1,5 +1,9 @@ | |
| 1304 #include "cache.h" | |
| 1305 | |
| 1306 +#ifdef __native_client__ | |
| 1307 +#define main nacl_main | |
| 1308 +#endif | |
| 1309 + | |
| 1310 int main(int argc, char **argv) | |
| 1311 { | |
| 1312 int i; | |
| 1313 diff --git a/upload-pack.c b/upload-pack.c | |
| 1314 --- a/upload-pack.c | |
| 1315 +++ b/upload-pack.c | |
| 1316 @@ -793,7 +793,11 @@ static int upload_pack_config(const char *var, const char *
value, void *unused) | |
| 1317 return parse_hide_refs_config(var, value, "uploadpack"); | |
| 1318 } | |
| 1319 | |
| 1320 +#if defined(__native_client__) | |
| 1321 +int nacl_main(int argc, char *argv[]) | |
| 1322 +#else | |
| 1323 int main(int argc, char **argv) | |
| 1324 +#endif | |
| 1325 { | |
| 1326 char *dir; | |
| 1327 int i; | |
| OLD | NEW |