From 7e13f8caed03da2ab9c992c0575386b98261f165 Mon Sep 17 00:00:00 2001 Message-Id: <7e13f8caed03da2ab9c992c0575386b98261f165.1367947969.git.minovotn@redhat.com> In-Reply-To: <707b9b97153063374d2530e72c49b1499fc21af9.1367947969.git.minovotn@redhat.com> References: <707b9b97153063374d2530e72c49b1499fc21af9.1367947969.git.minovotn@redhat.com> From: Laszlo Ersek Date: Mon, 6 May 2013 19:27:55 +0200 Subject: [PATCH 090/114] qemu-ga: Drop pointless lseek() from ga_open_pidfile() RH-Author: Laszlo Ersek Message-id: <1367868499-27603-33-git-send-email-lersek@redhat.com> Patchwork-id: 51131 O-Subject: [RHEL-6.5 qemu-kvm PATCH v2 32/56] qemu-ga: Drop pointless lseek() from ga_open_pidfile() Bugzilla: 952873 RH-Acked-by: Jeffrey Cody RH-Acked-by: Gerd Hoffmann RH-Acked-by: Paolo Bonzini From: Markus Armbruster After open(), the file offset is already zero, and neither lockf() nor ftruncate() change it. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Michael Roth Reviewed-by: Luiz Capitulino Signed-off-by: Michael Roth (cherry picked from commit 5d27f9ce3de424207883d84352d76150e9707394) Tech note: this is where I found out about diff.renameLimit and set it to 3000. The conflict due to the qemu-ga.c <-> qga/main.c rename is gone. Signed-off-by: Laszlo Ersek --- qemu-ga.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Signed-off-by: Michal Novotny --- qemu-ga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-ga.c b/qemu-ga.c index eb7fc7a..f8f6ac4 100644 --- a/qemu-ga.c +++ b/qemu-ga.c @@ -289,7 +289,7 @@ static bool ga_open_pidfile(const char *pidfile) return false; } - if (ftruncate(pidfd, 0) || lseek(pidfd, 0, SEEK_SET)) { + if (ftruncate(pidfd, 0)) { g_critical("Failed to truncate pid file"); goto fail; } -- 1.7.11.7