From da0a194b577df4088de1cc41da19363d014ab94c Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 5 Dec 2017 17:35:22 +0100 Subject: [PATCH] Print error cause of pcu socket connect failure This log is useful to quickly debug scenarions in which pcu never connects to bts. For instance, if bts is started as root and pcu is not, pcu will fail to connect to the socket and will fail with "Permission Denied". Change-Id: I6fd5736b5916cbad72b96f064929bb667ff97ded --- src/osmobts_sock.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index 31715d50..577d41eb 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -263,7 +263,8 @@ int pcu_l1if_open(void) rc = connect(bfd->fd, (struct sockaddr *) &local, namelen); if (rc != 0) { LOGP(DL1IF, LOGL_ERROR, "Failed to connect to the osmo-bts" - " PCU socket, delaying... '%s'\n", local.sun_path); + " PCU socket (%s), delaying... '%s'\n", + strerror(errno), local.sun_path); pcu_sock_state = state; close(bfd->fd); bfd->fd = -1;