summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-06-27 14:19:16 +0200
committerHarald Welte <laforge@gnumonks.org>2011-06-27 23:19:06 +0200
commitce9fec3e896571835ac5bfd2980d6836f2b29f0d (patch)
tree1c8d0700f0d37d490553db0bb641c1edbe04daaf
parent9fe1652212a84815e02d37f58d96192a1e6194d2 (diff)
Fix the generation of the log_categories string + LAPDM
... I should do more testing :( Conflicts: src/logging.c
-rw-r--r--src/logging.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/logging.c b/src/logging.c
index c05b523d..730fc37c 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -475,8 +475,9 @@ int log_target_file_reopen(struct log_target *target)
}
/* This generates the logging command string for VTY. */
-const char *log_vty_command_string(const struct log_info *info)
+const char *log_vty_command_string(const struct log_info *unused_info)
{
+ struct log_info *info = osmo_log_info;
int len = 0, offset = 0, ret, i, rem;
int size = strlen("logging level () ()") + 1;
char *str;
@@ -549,8 +550,9 @@ err:
}
/* This generates the logging command description for VTY. */
-const char *log_vty_command_description(const struct log_info *info)
+const char *log_vty_command_description(const struct log_info *unused_info)
{
+ struct log_info *info = osmo_log_info;
char *str;
int i, ret, len = 0, offset = 0, rem;
unsigned int size =
@@ -619,7 +621,7 @@ int log_init(const struct log_info *inf, void *ctx)
osmo_log_info->num_cat_user = inf->num_cat;
/* total number = number of user cat + library cat */
- osmo_log_info->num_cat = inf->num_cat + OSMO_NUM_DLIB;
+ osmo_log_info->num_cat = inf->num_cat + ARRAY_SIZE(internal_cat);
osmo_log_info->cat = talloc_zero_array(osmo_log_info,
struct log_info_cat,
@@ -638,7 +640,8 @@ int log_init(const struct log_info *inf, void *ctx)
/* copy over the library part */
for (i = 0; i < ARRAY_SIZE(internal_cat); i++) {
- memcpy(&osmo_log_info->cat[inf->num_cat+i],
+ unsigned int cn = osmo_log_info->num_cat_user + i;
+ memcpy(&osmo_log_info->cat[cn],
&internal_cat[i], sizeof(struct log_info_cat));
}