From a5ac001accd3566b910008cb5068802f7968b711 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sat, 3 Nov 2007 22:35:03 +0100 Subject: [PATCH] upload-pack: rely on finish_command() and finish_async() We don't need explicitly handle the processes anymore. --- upload-pack.c | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index 38b774fa34..34299308f8 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -265,29 +265,6 @@ static void create_pack_file(void) goto fail; } } - - if (finish_command(&pack_objects)) { - error("git-upload-pack: git-pack-objects died with error."); - goto fail; - } - if (finish_async(&rev_list)) - goto fail; /* error was already reported */ - - /* flush the data */ - if (0 <= buffered) { - data[0] = buffered; - sz = send_client_data(1, data, 1); - if (sz < 0) - goto fail; - fprintf(stderr, "flushed.\n"); - } - if (use_sideband) - packet_flush(1); - return; - - fail: - send_client_data(3, abort_msg, sizeof(abort_msg)); - die("git-upload-pack: %s", abort_msg); #else char *cp; @@ -322,6 +299,14 @@ static void create_pack_file(void) } else goto fail; +#endif + + if (finish_command(&pack_objects)) { + error("git-upload-pack: git-pack-objects died with error."); + goto fail; + } + if (finish_async(&rev_list)) + goto fail; /* error was already reported */ /* flush the data */ if (0 <= buffered) { @@ -333,16 +318,11 @@ static void create_pack_file(void) } if (use_sideband) packet_flush(1); - if (waitpid(pack_objects.pid, NULL, 0) < 0) - die("git-upload-pack: waiting for pack-objects: %s", - strerror(errno)); return; fail: - kill(pack_objects.pid, SIGKILL); send_client_data(3, abort_msg, sizeof(abort_msg)); die("git-upload-pack: %s", abort_msg); -#endif } static int got_sha1(char *hex, unsigned char *sha1)