paging_request() now returns the number of started paging requests

this helps the caller to determine if he will ever get called back
or not (and if he should free his data structures now or not)
This commit is contained in:
Harald Welte (local) 2009-08-15 11:25:45 +02:00
parent 10250e657b
commit 0abaf33297
2 changed files with 6 additions and 3 deletions

View File

@ -1046,7 +1046,7 @@ int gsm411_send_sms_subscr(struct gsm_subscriber *subscr,
/* if not, we have to start paging */
rc = paging_request(subscr->net, subscr, RSL_CHANNEED_SDCCH,
paging_cb_send_sms, sms);
if (rc < 0)
if (rc <= 0)
sms_free(sms);
return 0;

View File

@ -247,13 +247,16 @@ int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr,
int type, gsm_cbfn *cbfn, void *data)
{
struct gsm_bts *bts = NULL;
int rc;
int num_pages = 0;
/* start paging subscriber on all BTS within Location Area */
do {
int rc;
bts = gsm_bts_by_lac(network, subscr->lac, bts);
if (!bts)
break;
num_pages++;
/* Trigger paging, pass any error to caller */
rc = _paging_request(bts, subscr, type, cbfn, data);
@ -261,7 +264,7 @@ int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr,
return rc;
} while (1);
return 0;
return num_pages;
}