From patchwork Thu Apr 24 12:49:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 342649 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BD61A14015B for ; Fri, 25 Apr 2014 15:13:39 +1000 (EST) Received: from localhost ([::1]:53641 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdVWv-0001Ed-Vl for incoming@patchwork.ozlabs.org; Thu, 24 Apr 2014 22:06:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdUpS-0007b0-KZ for qemu-devel@nongnu.org; Thu, 24 Apr 2014 21:22:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdJ5i-0002AW-OH for qemu-devel@nongnu.org; Thu, 24 Apr 2014 08:49:36 -0400 Received: from cantor2.suse.de ([195.135.220.15]:48068 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdJ5i-00029q-HZ for qemu-devel@nongnu.org; Thu, 24 Apr 2014 08:49:26 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4DD80AD12; Thu, 24 Apr 2014 12:49:25 +0000 (UTC) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Thu, 24 Apr 2014 14:49:17 +0200 Message-Id: <1398343763-10704-5-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1398343763-10704-1-git-send-email-afaerber@suse.de> References: <1398343763-10704-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.135.220.15 Cc: Anthony Liguori , =?UTF-8?q?Andreas=20F=C3=A4rber?= , stefanha@redhat.com, brogers@suse.com Subject: [Qemu-devel] [PATCH 04/10] qtest: Add error reporting to socket_accept() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We're not using the GLib infrastructure here, to allow cleaning up the sockets. Still, knowing why a certain test run failed can be valuable. Signed-off-by: Andreas Färber --- tests/libqtest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/libqtest.c b/tests/libqtest.c index 232f781..4b90d91 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -93,6 +93,9 @@ static int socket_accept(int sock) do { ret = accept(sock, (struct sockaddr *)&addr, &addrlen); } while (ret == -1 && errno == EINTR); + if (ret == -1) { + fprintf(stderr, "%s failed: %s\n", __func__, strerror(errno)); + } close(sock); return ret;