From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 7B9373857023 for ; Mon, 29 Mar 2021 07:46:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7B9373857023 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A1D29AEA6; Mon, 29 Mar 2021 07:46:09 +0000 (UTC) Date: Mon, 29 Mar 2021 09:46:07 +0200 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com, mark@klomp.org Subject: [committed] Handle skip_multifile in encode/decode_child_exit_status Message-ID: <20210329074606.GA25979@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: dwz@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dwz mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2021 07:46:11 -0000 Hi, Handle skip_multifile in encode_child_exit_status and decode_child_exit_status. This is a preparation for running write_multifile in parallel. Committed to trunk. Thanks, - Tom Handle skip_multifile in encode/decode_child_exit_status 2021-03-29 Tom de Vries * dwz.c (encode_child_exit_status, decode_child_exit_status): Handle skip_multifile. --- dwz.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/dwz.c b/dwz.c index de600c1..9adc9df 100644 --- a/dwz.c +++ b/dwz.c @@ -16417,12 +16417,13 @@ update_hardlinks (int nr_files, char *files[], struct file_result *resa) static int encode_child_exit_status (int thisret, struct file_result *res) { + assert (thisret == 0 || thisret == 1); if (thisret == 0 && res->low_mem_p) thisret = 2; - assert (thisret >= 0 && thisret <= 2); - assert (res->res >= -3); - thisret = thisret + ((res->res + 3) << 2); - return thisret; + assert (res->res >= -3 && res->res <= 1); + return (thisret + + ((res->res + 3) << 2) + + ((res->skip_multifile ? 1 : 0) << 5)); } /* Decode child process exit status. */ @@ -16432,14 +16433,21 @@ decode_child_exit_status (int state, struct file_result *res) int ret; if (!WIFEXITED (state)) error (1, 0, "Child dwz process got killed"); - ret = WEXITSTATUS (state) & 0x3; + int status = WEXITSTATUS (state); + ret = status & 0x3; + status >>= 2; + res->low_mem_p = false; if (ret == 2) { ret = 0; res->low_mem_p = true; } - res->res = (int)((WEXITSTATUS (state) & ~0x3) >> 2) - 3; + + res->res = (int)(status & 0x7) - 3; + status >>= 3; + + res->skip_multifile = (status & 0x1) ? true : false; return ret; }