From nobody Sun May 19 08:30:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@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 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1640389519; cv=none; d=zohomail.com; s=zohoarc; b=Zk9RctM2NL4FTviIaa8iBN2s3MFOMiXZkjm84lIW+biMmzO2yC7I0xIwBRaFgxuV0FkvrCcij/SDMdOZDYh6p21dBzcTOdUaewlTa1yVvQ/jPqX+X0IxNMBpulF1MkpIMbk9sEA+0LVEuLmEqQXMuS96vNxOJcqiawxx8VaqnIU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640389519; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=djtV4Zg+5Y2t9qXSDNiQLJloqba1CwpOshfT6XZOspA=; b=mtnYwp68y04dB/Yzz2AhbPVe1VWFtm0EZLNWVw4jBEMq/zhmGCPU1yw6cdorGneo0qWfC9/+8cL7agfRoIZeOgl9osxVV8oxlJrCBKkblQpbrJ5Kn8dgbxxVh6+LQgxvq2LEueoYTdkquyqBfVpzFoNlExrsHeC0cb0rFQz42e4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1640389519903586.9358822269587; Fri, 24 Dec 2021 15:45:19 -0800 (PST) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-278-CQFq4hLHPViaDlEGczGuJw-1; Fri, 24 Dec 2021 18:45:15 -0500 Received: by mail-wr1-f72.google.com with SMTP id a11-20020adffb8b000000b001a0b0f4afe9so1708814wrr.13 for ; Fri, 24 Dec 2021 15:45:15 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (adijon-655-1-69-27.w90-13.abo.wanadoo.fr. [90.13.240.27]) by smtp.gmail.com with ESMTPSA id bg34sm13174955wmb.47.2021.12.24.15.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Dec 2021 15:45:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640389517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=djtV4Zg+5Y2t9qXSDNiQLJloqba1CwpOshfT6XZOspA=; b=BDDUcrvL9LUYbOFfoyDczHDNj1A4oopVrlapGqJQgmMMVpul95NWADA6yC4B6+SiPHDH2N cM8ZoBHzVmFN2hfyk81mrai3/NW0Gas5IOkFgDWAnrKaopdb1z15D9jDLsNWDS2f6+5Ff+ hGTtDYU8hsJzmVhIMKauOCKUZ8dr8T0= X-MC-Unique: CQFq4hLHPViaDlEGczGuJw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=djtV4Zg+5Y2t9qXSDNiQLJloqba1CwpOshfT6XZOspA=; b=GoTDF8OPfF55DvS0udth2jl7Ygq7WquTJ/h8wofa701ZZe8BIKG33nuBkmUbK+dBxv 7q8szLrXKEIkcDoROeL+4CcYXgLivWAdyi0vPV3twxqVNm1NMLkIPuQl4LTW9iSIIOlW kURYQUEdtH/ng94STFZlWQJ3Zy7OSFzb2NTMZuo0lyIv8oowqxmcKxu607L+cY1AQSVU KaZaPhT0ZBD+Y4eLmDpc9jIWKO9895lVsVvvknAimpIa1e9JkZFP9EUQfrdSy42Dh/cl XbsSDNjtWBkBnbzKYaE7N91IruXgJ6nJP7/YClQN1hibszSsVOT8kQOv9IpuqQsy+uHf Yp6w== X-Gm-Message-State: AOAM530HIqPQFQ5S0VV5lKjx5qHy64mNH5AJ/qcV22BX+Bm6h1aCKd3d lVaiKXhoGyxi1rgLWtYpNC5ctWZrP3MkLw84m723gVs9AMQQRFq7/3sLwbojsi5Kh1EAdAWt4fG npEGS2KNlOs92MQ== X-Received: by 2002:adf:ec85:: with SMTP id z5mr5836460wrn.568.1640389514088; Fri, 24 Dec 2021 15:45:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxwfXTXvZngkVd3lvDxTxowWvcYlkt/nFGVEaGHQbMnhcSQSIvNZ0BS8pIqAte4y5L2CUAmw== X-Received: by 2002:adf:ec85:: with SMTP id z5mr5836446wrn.568.1640389513859; Fri, 24 Dec 2021 15:45:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , qemu-trivial@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH] tests/unit/test-util-sockets: Use g_file_open_tmp() to create temp file Date: Sat, 25 Dec 2021 00:45:04 +0100 Message-Id: <20211224234504.3413370-1-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@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) X-ZM-MESSAGEID: 1640389520897000001 Similarly to commit e63ed64c6d1 ("tests/qtest/virtio-net-failover: Use g_file_open_tmp() to create temporary file"), avoid calling g_test_rand_int() before g_test_init(): use g_file_open_tmp(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- tests/unit/test-util-sockets.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit/test-util-sockets.c b/tests/unit/test-util-sockets.c index 72b92465298..896247e3ed3 100644 --- a/tests/unit/test-util-sockets.c +++ b/tests/unit/test-util-sockets.c @@ -305,9 +305,11 @@ static void test_socket_unix_abstract(void) }; int i; =20 + i =3D g_file_open_tmp("unix-XXXXXX", &addr.u.q_unix.path, NULL); + g_assert_true(i >=3D 0); + close(i); + addr.type =3D SOCKET_ADDRESS_TYPE_UNIX; - addr.u.q_unix.path =3D g_strdup_printf("unix-%d-%u", - getpid(), g_random_int()); addr.u.q_unix.has_abstract =3D true; addr.u.q_unix.abstract =3D true; addr.u.q_unix.has_tight =3D false; --=20 2.33.1