From: Junio C Hamano Date: Mon, 21 Jun 2010 13:02:45 +0000 (-0700) Subject: Merge branch 'js/async-thread' X-Git-Tag: v1.7.2-rc0~31 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=762655010d6f051f632a77b8c5b95b9f5cad02c9;p=git.git Merge branch 'js/async-thread' * js/async-thread: fast-import: die_nicely() back to vsnprintf (reverts part of ebaa79f) Enable threaded async procedures whenever pthreads is available Dying in an async procedure should only exit the thread, not the process. Reimplement async procedures using pthreads Windows: more pthreads functions Fix signature of fcntl() compatibility dummy Make report() from usage.c public as vreportf() and use it. Modernize t5530-upload-pack-error. Conflicts: http-backend.c --- 762655010d6f051f632a77b8c5b95b9f5cad02c9 diff --cc http-backend.c index f0e787e37,8c7b7d09e..44ce6bb32 --- a/http-backend.c +++ b/http-backend.c @@@ -485,19 -538,12 +485,17 @@@ static void service_rpc(char *service_n static NORETURN void die_webcgi(const char *err, va_list params) { - http_status(500, "Internal Server Error"); - hdr_nocache(); - end_headers(); + static int dead; - vreportf("fatal: ", err, params); - exit(0); + if (!dead) { - char buffer[1000]; + dead = 1; - - vsnprintf(buffer, sizeof(buffer), err, params); - fprintf(stderr, "fatal: %s\n", buffer); + http_status(500, "Internal Server Error"); + hdr_nocache(); + end_headers(); ++ ++ vreportf("fatal: ", err, params); + } + exit(0); /* we successfully reported a failure ;-) */ } static char* getdir(void) diff --cc run-command.c index c7793f50f,61b153987..2a1041ef6 --- a/run-command.c +++ b/run-command.c @@@ -79,11 -77,12 +79,12 @@@ static NORETURN void die_child(const ch if (len > sizeof(msg)) len = sizeof(msg); - write(child_err, "fatal: ", 7); - write(child_err, msg, len); - write(child_err, "\n", 1); + unused = write(child_err, "fatal: ", 7); + unused = write(child_err, msg, len); + unused = write(child_err, "\n", 1); exit(128); } + #endif static inline void set_cloexec(int fd) {