From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuqCi-0001EZ-1T for qemu-devel@nongnu.org; Mon, 14 Jan 2013 15:00:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuqCh-0008PD-4X for qemu-devel@nongnu.org; Mon, 14 Jan 2013 15:00:19 -0500 Received: from mail-ie0-f169.google.com ([209.85.223.169]:64198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuqCh-0008P0-02 for qemu-devel@nongnu.org; Mon, 14 Jan 2013 15:00:19 -0500 Received: by mail-ie0-f169.google.com with SMTP id c14so5846634ieb.0 for ; Mon, 14 Jan 2013 12:00:18 -0800 (PST) Sender: fluxion From: Michael Roth Date: Mon, 14 Jan 2013 13:55:08 -0600 Message-Id: <1358193312-15960-5-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1358193312-15960-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1358193312-15960-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 4/8] qemu-ga: Drop pointless lseek() from ga_open_pidfile() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, armbru@redhat.com, lcapitulino@redhat.com 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 --- qga/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/main.c b/qga/main.c index e8a9a9e..96d3cfa 100644 --- a/qga/main.c +++ b/qga/main.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.9.5