From patchwork Fri Jan 11 10:24:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/6] qemu-ga: Drop pointless lseek() from ga_open_pidfile() Date: Fri, 11 Jan 2013 00:24:58 -0000 From: Markus Armbruster X-Patchwork-Id: 211287 Message-Id: <1357899902-5316-3-git-send-email-armbru@redhat.com> To: qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com After open(), the file offset is already zero, and neither lockf() nor ftruncate() change it. Signed-off-by: Markus Armbruster Reviewed-by: Michael Roth --- qga/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/main.c b/qga/main.c index 47a6bea..1a22d8d 100644 --- a/qga/main.c +++ b/qga/main.c @@ -276,7 +276,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; }