From patchwork Tue Nov 14 22:57:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 79884 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 24B9938618DD for ; Tue, 14 Nov 2023 22:58:16 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id A425538708EB for ; Tue, 14 Nov 2023 22:58:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A425538708EB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A425538708EB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.77.166.138 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700002684; cv=none; b=tVK9ZyIDlyTQaoDAUUFco92mLN14uesdfkpaM2NHmV8aKCF4qCXSTyWv0y+MBS3CCJoT6SYu1h6JPDqQk1L8fQbPupyjLuhodxItK8kej1mq9iXkxtsuRKWdiKpA1xo96ozqfX5PXx5N1C5ER/LcAVw3hskYLGAdkQRKZyw7rxA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700002684; c=relaxed/simple; bh=3ApWw0Du4pTSjTK6tZ04tNe+sbcUzFZf52r3wc9hJEE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=CAzItLVsj2eA/W/wI9rA+Go+7Li9Qms+TaPxwed/4oavszS/Wn87d56foaByffK8peB3wlYjHWy/ikNvQ+85a1HKgwxH7XGOcbi87qi6GK0Xznx2P+4vOwj+pxq5UfIaas1qxSL34wAsCgG7EkLGZZiJL30lMD8f54zv+zJIJZg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id AE8AE2013E; Tue, 14 Nov 2023 23:58:00 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mkTroIvdISJI; Tue, 14 Nov 2023 23:58:00 +0100 (CET) Received: from begin.home (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr [83.192.234.57]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 8E0D12013C; Tue, 14 Nov 2023 23:58:00 +0100 (CET) Received: from samy by begin.home with local (Exim 4.97) (envelope-from ) id 1r32M4-00000009dnn-0VNX; Tue, 14 Nov 2023 23:58:00 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited] hurd: Fix spawni returning allocation errors. Date: Tue, 14 Nov 2023 23:57:59 +0100 Message-ID: <20231114225759.2297944-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org --- sysdeps/mach/hurd/spawni.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sysdeps/mach/hurd/spawni.c b/sysdeps/mach/hurd/spawni.c index 5e05308066..9516001817 100644 --- a/sysdeps/mach/hurd/spawni.c +++ b/sysdeps/mach/hurd/spawni.c @@ -787,12 +787,18 @@ retry: /* Relative path */ char *cwd = __getcwd (NULL, 0); if (cwd == NULL) - goto out; + { + err = errno; + goto out; + } res = __asprintf (&concat_name, "%s/%s", cwd, relpath); free (cwd); if (res == -1) - goto out; + { + err = errno; + goto out; + } abspath = concat_name; }