aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2012-08-15 23:52:51 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2012-08-16 00:31:00 +0200
commit4ab29914389f850b5ca9f1f44ce90e9f25076960 (patch)
treede5369c105a0cf1281759a480ac270841abb9b85
parent373d1e6540c64ab09a974c71deeb1eeacd68d5bf (diff)
channel: display error messages for channel_open()
Using generic osmocom logging infrastructure
-rw-r--r--src/channel.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/channel.c b/src/channel.c
index dfca5aa..0fe9e17 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -1,5 +1,6 @@
#include <osmocom/core/talloc.h>
#include <osmocom/core/msgb.h>
+#include <osmocom/core/logging.h>
#include <osmocom/netif/channel.h>
@@ -15,17 +16,23 @@ struct osmo_chan *osmo_chan_create(void *ctx, int type_id)
{
struct osmo_chan *c;
- if (type_id >= CHAN_MAX)
+ if (type_id >= CHAN_MAX) {
+ LOGP(DLINP, LOGL_ERROR, "unsupported channel type `%u'\n",
+ type_id);
return NULL;
+ }
c = talloc_zero_size(ctx, sizeof(struct osmo_chan) +
chan_type[type_id]->datasiz);
- if (c == NULL)
+ if (c == NULL) {
+ LOGP(DLINP, LOGL_ERROR, "cannot allocate channel data\n");
return NULL;
+ }
c->ops = chan_type[type_id];
if (c->ops->create(c) < 0) {
+ LOGP(DLINP, LOGL_ERROR, "cannot create channel\n");
talloc_free(c);
return NULL;
}