From nobody Thu May 2 01:52:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600709954; cv=none; d=zohomail.com; s=zohoarc; b=Qo2KLK6JjYFPg6TxFvepzD95l1NiCFVjvrrkO4KG7+h9fNhrlAZH3BDBuMIpS8L99qn8eYN7Mr6793aezGsRvIEsH+SYMN+gVbY81z8LV+NovYoP+aSYB50Z7c4cl3jijwRyAcLmv/yadHhcFpKLrk1mnIp5admRXp0tuxSIagE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600709954; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=TqnrCZXNr/rKiCgHIwA9eC9tRfAS1vkLlAeMmIm5Ja4=; b=Vw65u09X92XsE3uPJnnDP46u0VgCkaZN3uxtib3YCD+k5cXkMZYm6do39GaE0DSYf1HI7DOKPoXu1HY/EHTiuedO4ELaoWbomw4a2Nlcn9ahcaFkWoy0786rCNo2BmGohcJzzKlv6aiyuUoa6zOmNHuvmlAzhZ1cHxd8BvAFh0k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600709954361232.5078576817333; Mon, 21 Sep 2020 10:39:14 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-382-fFodY9Y4NyK5fFndf3w4xg-1; Mon, 21 Sep 2020 13:39:10 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5EA5B64150; Mon, 21 Sep 2020 17:39:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B948960C11; Mon, 21 Sep 2020 17:39:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1704D183D041; Mon, 21 Sep 2020 17:39:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08LHd2tM020452 for ; Mon, 21 Sep 2020 13:39:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 786EF73681; Mon, 21 Sep 2020 17:39:02 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-113-113.ams2.redhat.com [10.36.113.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id 705467366A; Mon, 21 Sep 2020 17:38:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600709953; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=TqnrCZXNr/rKiCgHIwA9eC9tRfAS1vkLlAeMmIm5Ja4=; b=i+nCgc+DakRHUIxIk054Jb2A5l/Rx1NyMYiTE5T7VfJp9/EjDcv15mwd/LP3zgErP7CXnw OdFarwCar5M3yd49UCwm9VM5kaB/LjFdUE1qhngyaSSb6FbfgTEpGft82SKmjmPbXKYDr5 DyqE7qwaFln9B740Y05ml6M5yTZZH+E= X-MC-Unique: fFodY9Y4NyK5fFndf3w4xg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [PATCH] tests: avoid close of bad file handle in commandtest Date: Mon, 21 Sep 2020 18:38:54 +0100 Message-Id: <20200921173854.1987219-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Closed file handles need to be initialized to -1, not 0. This caused a inappropriate double close of stdin, which is not desirable, although it had no ill effects. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Eric Blake --- tests/commandtest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/commandtest.c b/tests/commandtest.c index 42225a8ef2..cbbcda4e5f 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -1091,8 +1091,8 @@ static int test27(const void *unused G_GNUC_UNUSED) printf("Could not set send buffers\n"); goto cleanup; } - pipe1[1] =3D 0; - pipe2[1] =3D 0; + pipe1[1] =3D -1; + pipe2[1] =3D -1; buffer1 =3D NULL; buffer2 =3D NULL; =20 --=20 2.26.2