diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2017-08-19 12:15:15 +0600 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2017-11-19 17:35:07 +0700 |
commit | 3641fe61238aabaa84ecbf14ca8eefe18acd5b18 (patch) | |
tree | 368ca4b52184affc5ac16fab4de20aa593f0f849 /src | |
parent | f979d44a72115050e3be95a7ce9bf29bffe964dc (diff) |
host/trxcon: use LOGP instead of fprintf
There is no (performance) reason to use fprintf instead of LOGP.
Second one provides more useful information, such as a file name
and a line number.
Change-Id: I86dda5b3d746c7802442e4226578a06c04941721
Diffstat (limited to 'src')
-rw-r--r-- | src/host/trxcon/l1ctl_link.c | 6 | ||||
-rw-r--r-- | src/host/trxcon/trx_if.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c index c38a8715..3bbdf34b 100644 --- a/src/host/trxcon/l1ctl_link.c +++ b/src/host/trxcon/l1ctl_link.c @@ -74,7 +74,7 @@ static int l1ctl_link_read_cb(struct osmo_fd *bfd) msg = msgb_alloc_headroom(L1CTL_LENGTH + L1CTL_HEADROOM, L1CTL_HEADROOM, "L1CTL"); if (!msg) { - fprintf(stderr, "Failed to allocate msg\n"); + LOGP(DL1D, LOGL_ERROR, "Failed to allocate msg\n"); return -ENOMEM; } @@ -236,7 +236,7 @@ int l1ctl_link_init(struct l1ctl_link **l1l, const char *sock_path) l1l_new = talloc_zero(tall_trx_ctx, struct l1ctl_link); if (!l1l_new) { - fprintf(stderr, "Failed to allocate memory\n"); + LOGP(DL1C, LOGL_ERROR, "Failed to allocate memory\n"); return -ENOMEM; } @@ -245,7 +245,7 @@ int l1ctl_link_init(struct l1ctl_link **l1l, const char *sock_path) rc = osmo_sock_unix_init_ofd(bfd, SOCK_STREAM, 0, sock_path, OSMO_SOCK_F_BIND); if (rc < 0) { - fprintf(stderr, "Could not create UNIX socket: %s\n", + LOGP(DL1C, LOGL_ERROR, "Could not create UNIX socket: %s\n", strerror(errno)); talloc_free(l1l_new); return rc; diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c index 5820d707..368c4742 100644 --- a/src/host/trxcon/trx_if.c +++ b/src/host/trxcon/trx_if.c @@ -636,7 +636,7 @@ int trx_if_open(struct trx_instance **trx, const char *host, uint16_t port) /* Try to allocate memory */ trx_new = talloc_zero(tall_trx_ctx, struct trx_instance); if (!trx_new) { - fprintf(stderr, "Failed to allocate memory\n"); + LOGP(DTRX, LOGL_ERROR, "Failed to allocate memory\n"); return -ENOMEM; } |