qemu-ga: Drop pointless lseek() from ga_open_pidfile()
authorMarkus Armbruster <armbru@redhat.com>
Fri, 11 Jan 2013 10:24:58 +0000 (11:24 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 14 Jan 2013 18:07:37 +0000 (12:07 -0600)
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>
qga/main.c

index e8a9a9ee7e9862ac0dbae553cf97746c1a70357d..96d3cfa381b2e6464d94ef8d9a50432d3c148060 100644 (file)
@@ -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;
     }