From nobody Mon Feb 9 10:29:02 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1664355501; cv=none; d=zohomail.com; s=zohoarc; b=FTDa72vwhJc2iysiJa19SAjr8cTyWEK6JK/h4si9N01FADkL5k+P2hQeJVLnw+BY5nE6HjZTfVd0QsazowvKZyqlB5i0zYqVxIqN4ELspBwZPPtnU8kGKK+QTfQSzHp9Bo09w5ewJJyvjpio/xCxxTI/0RmXZ7d2g1lc4GXDMEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664355501; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HI/VfznO4UQL0HIy+S9kEIJ2JLBmNqz4yZVlxkh6YTo=; b=gLIg26kMnlpLBIaC18IOAiz90yckBsx8EGLrle+J9ZjWU96N8VTAb3MshVb+2L/sUG6nGuEJ5dNlu3vze8CpBUjZEs/HhPX60J6+iHDLU0sUqbsPDrMa7TDJFhbmCnORihqy/FgjKpLQqMcbDf2Jxq/rlUy9NPzJWg1Z2Q0sAGE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1664355501655299.39391130981664; Wed, 28 Sep 2022 01:58:21 -0700 (PDT) Received: from localhost ([::1]:51754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odStX-0004dK-I3 for importer@patchew.org; Wed, 28 Sep 2022 04:58:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM9-000190-Q3 for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48265) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM4-00005k-DV for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:44 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-640-uN94-AHnM32axM_88FVTHA-1; Wed, 28 Sep 2022 03:19:34 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 43ABB882821; Wed, 28 Sep 2022 07:19:34 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB67340C83BB; Wed, 28 Sep 2022 07:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349579; 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: in-reply-to:in-reply-to:references:references; bh=HI/VfznO4UQL0HIy+S9kEIJ2JLBmNqz4yZVlxkh6YTo=; b=a185CCzzTIt/zA7qSTGYU4629JhkI7uixlugrg63DZBurbEBJU0Zmj4jmNjpk+4p6jp9ep 4JvuaOQsNycUVcZlbfLPy+KOzyFDwF7zrwWcv0IKA6jUIcnGW+EUTgqdc6uVdLdjNlZUsS /mCgSW3vu/6pojApLYt/gMp1SpmSwg8= X-MC-Unique: uN94-AHnM32axM_88FVTHA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 25/37] tests/qtest: ide-test: Open file in binary mode Date: Wed, 28 Sep 2022 09:18:31 +0200 Message-Id: <20220928071843.1468323-26-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664355502140100001 From: Xuzhou Cheng By default Windows opens file in text mode, while a POSIX compliant implementation treats text files and binary files the same. The fopen() 'mode' string can include the letter 'b' to indicate binary mode shall be used. POSIX spec says the character 'b' shall have no effect, but is allowed for ISO C standard conformance. Let's add the letter 'b' which works on both POSIX and Windows. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-41-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/ide-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c index 5e3e28aea2..4ea89c26c9 100644 --- a/tests/qtest/ide-test.c +++ b/tests/qtest/ide-test.c @@ -892,7 +892,7 @@ static void cdrom_pio_impl(int nblocks) =20 /* Prepopulate the CDROM with an interesting pattern */ generate_pattern(pattern, patt_len, ATAPI_BLOCK_SIZE); - fh =3D fopen(tmp_path, "w+"); + fh =3D fopen(tmp_path, "wb+"); ret =3D fwrite(pattern, ATAPI_BLOCK_SIZE, patt_blocks, fh); g_assert_cmpint(ret, =3D=3D, patt_blocks); fclose(fh); @@ -993,7 +993,7 @@ static void test_cdrom_dma(void) prdt[0].size =3D cpu_to_le32(len | PRDT_EOT); =20 generate_pattern(pattern, ATAPI_BLOCK_SIZE * 16, ATAPI_BLOCK_SIZE); - fh =3D fopen(tmp_path, "w+"); + fh =3D fopen(tmp_path, "wb+"); ret =3D fwrite(pattern, ATAPI_BLOCK_SIZE, 16, fh); g_assert_cmpint(ret, =3D=3D, 16); fclose(fh); --=20 2.31.1