Skip to content

Commit

Permalink
os-posix: remove confused errno
Browse files Browse the repository at this point in the history
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 <eblake@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
gongleiarei authored and Michael Tokarev committed Sep 26, 2014
1 parent 63ce8e1 commit 97699ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion os-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 97699ef

Please sign in to comment.