From patchwork Thu Jan 22 00:26:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 19744 X-Patchwork-Delegate: jk@ozlabs.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 65135DDFD4 for ; Thu, 22 Jan 2009 14:37:23 +1100 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org Received: from hera.kernel.org (hera.kernel.org [140.211.167.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2B1D7DDF85; Thu, 22 Jan 2009 14:31:57 +1100 (EST) Received: from hera.kernel.org (IDENT:U2FsdGVkX19CYZKv3WBx8XjwmtSQGtdekVyv8GsrY6Y@localhost [127.0.0.1]) by hera.kernel.org (8.14.2/8.14.2) with ESMTP id n0M3A2EV002962 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Jan 2009 03:10:02 GMT Received: (from geoff@localhost) by hera.kernel.org (8.14.2/8.13.1/Submit) id n0M3A2vU002961; Thu, 22 Jan 2009 03:10:02 GMT Message-Id: <20090122002653.471882671@am.sony.com> References: <20090122002653.146035454@am.sony.com> User-Agent: quilt/0.46-1 Date: Wed, 21 Jan 2009 16:26:57 -0800 From: Geoff Levand To: Jeremy Kerr Content-Disposition: inline; filename=use-log-in-client.diff X-Virus-Scanned: ClamAV 0.93.3/8886/Wed Jan 21 22:46:06 2009 on hera.kernel.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hera.kernel.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (hera.kernel.org [127.0.0.1]); Thu, 22 Jan 2009 03:10:04 +0000 (UTC) Cc: cbe-oss-dev@ozlabs.org Subject: [Cbe-oss-dev] [patch 4/9] petitboot: Change client to use pb_log X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Change any use of the standard io streams in the client routines to use pb_log(). Signed-off-by: Geoff Levand --- ui/common/discover-client.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --- a/ui/common/discover-client.c +++ b/ui/common/discover-client.c @@ -1,4 +1,5 @@ +#include #include #include #include @@ -9,6 +10,7 @@ #include #include +#include #include "ui/common/discover-client.h" #include "pb-protocol/pb-protocol.h" @@ -41,7 +43,7 @@ struct discover_client* discover_client_ client->fd = socket(AF_UNIX, SOCK_STREAM, 0); if (!client->fd < 0) { - perror("socket"); + pb_log("%s: socket: %s\n", __func__, strerror(errno)); goto out_err; } @@ -51,7 +53,7 @@ struct discover_client* discover_client_ strcpy(addr.sun_path, PB_SOCKET_PATH); if (connect(client->fd, (struct sockaddr *)&addr, sizeof(addr))) { - perror("connect"); + pb_log("%s: connect: %s\n", __func__, strerror(errno)); goto out_err; } @@ -87,7 +89,7 @@ int discover_client_process(struct disco case PB_PROTOCOL_ACTION_ADD: dev = pb_protocol_deserialise_device(client, message); if (!dev) { - printf("no device?\n"); + pb_log("%s: no device?\n", __func__); return 0; } client->ops.add_device(dev); @@ -96,13 +98,13 @@ int discover_client_process(struct disco case PB_PROTOCOL_ACTION_REMOVE: dev_id = pb_protocol_deserialise_string(client, message); if (!dev_id) { - printf("no device id?\n"); + pb_log("%s: no device id?\n", __func__); return 0; } client->ops.remove_device(dev_id); break; default: - printf("unknown action %d\n", message->action); + pb_log("%s: unknown action %d\n", __func__, message->action); }