qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 4/8] qemu-ga: Drop pointless lseek() from ga_open_pi


From: Michael Roth
Subject: [Qemu-devel] [PATCH 4/8] qemu-ga: Drop pointless lseek() from ga_open_pidfile()
Date: Mon, 14 Jan 2013 13:55:08 -0600

From: Markus Armbruster <address@hidden>

After open(), the file offset is already zero, and neither lockf() nor
ftruncate() change it.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Michael Roth <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>
Signed-off-by: Michael Roth <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]