qemu-trivial
[Top][All Lists]
Advanced

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

[Qemu-trivial] [PULL 11/12] os-posix: remove confused errno


From: Michael Tokarev
Subject: [Qemu-trivial] [PULL 11/12] os-posix: remove confused errno
Date: Fri, 26 Sep 2014 21:36:15 +0400

From: Gonglei <address@hidden>

If we get inside the 'else if (status == 1)' conditional,
then we know that read() succeeded, and therefore errno is
unspecified. Printing strerror(errno) on a random value
is not helpful.

Cc: Eric Blake <address@hidden>
Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
 os-posix.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/os-posix.c b/os-posix.c
index f0564ef..e31a099 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -226,7 +226,7 @@ void os_daemonize(void)
                 exit(1);
             }
             else if (status == 1) {
-                fprintf(stderr, "Could not acquire pidfile: %s\n", 
strerror(errno));
+                fprintf(stderr, "Could not acquire pidfile\n");
                 exit(1);
             } else {
                 exit(0);
-- 
1.7.10.4




reply via email to

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