From nobody Sun Feb 8 18:15:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1577977013; cv=none; d=zohomail.com; s=zohoarc; b=PFa52X4eyegbMCYfR5wWigMR/6O+bSbHsgfdc7KjNJ0cXRAGjLtNd+/dzRLOLsFUtHVAsKH0GnPqdYqA+Bxd/i4/pjxoIPBBPA4I+uLLfH9DszU22LMrL24cMI6HlMeH9O7o27rOQincouI04okCBibNpehCLghVDu89BBQT3+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577977013; h=Content-Type:Content-Transfer-Encoding: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=rMfowP4yOPrOTSNu8tpe0PLwWl4kijGccEWKyBDPlT0=; b=jZhAsg87bW2FR4J7a4VqBA7VlLbSqYd0tpfpyerKEjSOndHcoQKanGxZFk1kOEHupb3MUIWOs8ByTZ+eBpHbKpxaTyLTKrV+fRjEwmnWW4aalVxZjk6N8z05UwUsYtSKGgkXsT1AP7YqdJL7c1+yxkYFe/2MMd+NSqzHbL3niic= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1577977013873915.8439993307685; Thu, 2 Jan 2020 06:56:53 -0800 (PST) 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-358-KtBZ-sTdOWyYSUDWEIXHpw-1; Thu, 02 Jan 2020 09:56:49 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2AD371005510; Thu, 2 Jan 2020 14:56:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0646F7A4DB; Thu, 2 Jan 2020 14:56:43 +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 B5A0881E36; Thu, 2 Jan 2020 14:56:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 002EuVkx004775 for ; Thu, 2 Jan 2020 09:56:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id E611560C88; Thu, 2 Jan 2020 14:56:31 +0000 (UTC) Received: from catbus.gsslab.fab.redhat.com (dhcp-43.gsslab.fab.redhat.com [10.33.9.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 560D560BF4; Thu, 2 Jan 2020 14:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1577977012; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=rMfowP4yOPrOTSNu8tpe0PLwWl4kijGccEWKyBDPlT0=; b=G4viqB75jzuK98bvDKfES88nMoIphm1rKurLkEaAFRFhrk9uE9PljMOkTxE1NyS/DKIMhT ZSrbQSiIUTHhTDv98Kd9rcFr7IvKlVJlK0xcgRGTDwpJoMEjVAbymuMyZM5R9pNcXwYwpN iXpfK0vCqRjVvXHSV9OZquJ/UEpMqPA= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 2 Jan 2020 14:53:42 +0000 Message-Id: <20200102145357.6724-9-berrange@redhat.com> In-Reply-To: <20200102145357.6724-1-berrange@redhat.com> References: <20200102145357.6724-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/23] src: use g_fsync for portability 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.15 X-MC-Unique: KtBZ-sTdOWyYSUDWEIXHpw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The g_fsync() API provides the same Windows portability as GNULIB does for fsync(). Signed-off-by: Daniel P. Berrang=C3=A9 --- src/nwfilter/nwfilter_dhcpsnoop.c | 2 +- src/storage/storage_util.c | 2 +- src/util/virfile.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.c index 9514dfd75c..9a71d13d57 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -1772,7 +1772,7 @@ virNWFilterSnoopLeaseFileWrite(int lfd, const char *i= fkey, goto cleanup; } =20 - ignore_value(fsync(lfd)); + ignore_value(g_fsync(lfd)); =20 cleanup: VIR_FREE(lbuf); diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index f2d8810813..c1a6b44f4b 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -384,7 +384,7 @@ createRawFile(int fd, virStorageVolDefPtr vol, } } =20 - if (fsync(fd) < 0) { + if (g_fsync(fd) < 0) { ret =3D -errno; virReportSystemError(errno, _("cannot sync data to file '%s'"), vol->target.path); diff --git a/src/util/virfile.c b/src/util/virfile.c index 0f0d607c59..1784895575 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -519,7 +519,7 @@ virFileRewrite(const char *path, goto cleanup; } =20 - if (fsync(fd) < 0) { + if (g_fsync(fd) < 0) { virReportSystemError(errno, _("cannot sync file '%s'"), newfile); goto cleanup; --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list