summaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-01-25 10:01:30 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-01-25 10:01:30 +0100
commit88ca894df7dd0bec04c8406ea7efe53d54cc3fc4 (patch)
tree0e57c294d1d48349c43e2bc07747b514941f2a8e /openbsc
parent42b0d6b4948ead0fadfd5085da689687b2fe5e9f (diff)
[nat] Handle write errors with a warning to make the compiler happy
Make the compiler happy by checking the write error and printing a message to the console.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/nat/bsc_nat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index 98eaa9794..3f0a387a0 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -102,6 +102,7 @@ static void initialize_msc_if_needed()
static void forward_sccp_to_bts(struct msgb *msg)
{
struct bsc_connection *bsc;
+ int rc;
/* filter, drop, patch the message? */
@@ -111,7 +112,11 @@ static void forward_sccp_to_bts(struct msgb *msg)
/* currently send this to every BSC connected */
llist_for_each_entry(bsc, &bsc_connections, list_entry) {
- write(bsc->bsc_fd.fd, msg->data, msg->len);
+ rc = write(bsc->bsc_fd.fd, msg->data, msg->len);
+
+ /* try the next one */
+ if (rc < msg->len)
+ fprintf(stderr, "Failed to write message to BTS.\n");
}
}