test_apps: Fix compilation of example smsc code

Change-Id: I12f4daefaa07a1c1b42dc295724e3ec0bdcddfd7
This commit is contained in:
Harald Welte 2021-10-10 19:53:46 +02:00
parent 6613063fba
commit a53391d885
2 changed files with 5 additions and 3 deletions

View File

@ -498,7 +498,7 @@ dead_socket:
}
/* call-back of write queue once it wishes to write a message to the socket */
static void esme_link_write_cb(struct osmo_fd *ofd, struct msgb *msg)
static int esme_link_write_cb(struct osmo_fd *ofd, struct msgb *msg)
{
struct osmo_esme *esme = ofd->data;
int rc;
@ -511,8 +511,10 @@ static void esme_link_write_cb(struct osmo_fd *ofd, struct msgb *msg)
smpp_esme_put(esme);
} else if (rc < msgb_length(msg)) {
LOGP(DSMPP, LOGL_ERROR, "%s: Short write\n", esme->system_id);
return;
return -1;
}
return 0;
}
/* callback for already-accepted new TCP socket */

View File

@ -34,7 +34,7 @@ int main(int argc, char **argv)
struct smsc *smsc = talloc_zero(NULL, struct smsc);
int rc;
osmo_init_logging(&log_info);
osmo_init_logging2(smsc, &log_info);
strcpy(smsc->system_id, "OpenBSC");
rc = smpp_smsc_init(smsc, 6080);