aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-02-24 19:29:59 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-02-25 12:18:03 +0100
commit127fc93a132252478e59b821665e31f2ec1df267 (patch)
tree41de1177b7b09bbd5daf5687d3bddf5d205a0da2 /openbsc/src
parent547f048c894cc3e41ca482798f9a13d814f378a5 (diff)
ipaccess_rcvmsg: fix returncode, add partial write warning
Kills a compiler warning.
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/ipaccess/ipaccess-proxy.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/openbsc/src/ipaccess/ipaccess-proxy.c
index ab43b9efb..4077b3f38 100644
--- a/openbsc/src/ipaccess/ipaccess-proxy.c
+++ b/openbsc/src/ipaccess/ipaccess-proxy.c
@@ -527,6 +527,12 @@ static int ipaccess_rcvmsg(struct ipa_proxy_conn *ipc, struct msgb *msg,
return -EIO;
}
ret = write(bfd->fd, ipbc->id_resp, ipbc->id_resp_len);
+ if (ret != ipbc->id_resp_len) {
+ LOGP(DLINP, LOGL_ERROR, "Partial write: %d of %d\n",
+ ret, ipbc->id_resp_len);
+ return -EIO;
+ }
+ ret = 0;
break;
case IPAC_MSGT_ID_ACK:
DEBUGP(DLMI, "ID_ACK? -> ACK!\n");
@@ -537,7 +543,7 @@ static int ipaccess_rcvmsg(struct ipa_proxy_conn *ipc, struct msgb *msg,
return 1;
break;
}
- return 0;
+ return ret;
}
struct msgb *ipaccess_proxy_read_msg(struct osmo_fd *bfd, int *error)