Skip to content

Commit

Permalink
qemu-ga: Drop pointless lseek() from ga_open_pidfile()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Armbruster authored and mdroth committed Jan 14, 2013
1 parent f5b7957 commit 5d27f9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qga/main.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5d27f9c

Please sign in to comment.