summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2009-06-02 02:54:48 +0000
committerHolger Freyther <zecke@selfish.org>2009-06-02 02:54:48 +0000
commit3e0ef7ccbec1949934c9a86c7711ec60052d727d (patch)
tree815cd84db727c8d419b6efcdea5b9b84ff592ac1
parent6d5200b217e42f084810736a6a18bdc4ff76898e (diff)
[subscriber] Log changes in the usage of a subscriber (Andreas Eversberg)
Log changes of the use count of a gsm_subscriber.
-rw-r--r--src/gsm_subscriber.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gsm_subscriber.c b/src/gsm_subscriber.c
index 67aa7936b..488850637 100644
--- a/src/gsm_subscriber.c
+++ b/src/gsm_subscriber.c
@@ -27,6 +27,7 @@
#include <string.h>
#include <openbsc/gsm_subscriber.h>
+#include <openbsc/debug.h>
#include <openbsc/db.h>
@@ -119,12 +120,17 @@ int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason)
struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr)
{
subscr->use_count++;
+ DEBUGP(DCC, "subscr %s usage increases usage to: %d\n",
+ subscr->extension, subscr->use_count);
return subscr;
}
struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr)
{
- if (--subscr->use_count <= 0)
+ subscr->use_count--;
+ DEBUGP(DCC, "subscr %s usage decreased usage to: %d\n",
+ subscr->extension, subscr->use_count);
+ if (subscr->use_count <= 0)
subscr_free(subscr);
return NULL;
}