From: Markus Armbruster Date: Fri, 11 Jan 2013 10:24:58 +0000 (+0100) Subject: qemu-ga: Drop pointless lseek() from ga_open_pidfile() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5d27f9ce3de424207883d84352d76150e9707394;p=qemu.git qemu-ga: Drop pointless lseek() from ga_open_pidfile() 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 --- diff --git a/qga/main.c b/qga/main.c index e8a9a9ee7e..96d3cfa381 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; }