aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2013-01-11 11:24:58 +0100
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-01-14 12:07:37 -0600
commit5d27f9ce3de424207883d84352d76150e9707394 (patch)
treea9fe2e137142f4c021b74740cbe9dcd984402936
parentf5b795787864ddde1104a4f7c061dcb0e58e45c0 (diff)
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 <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--qga/main.c2
1 files changed, 1 insertions, 1 deletions
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;
}