flight recorder: don't hardcode max arguments everywhere

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2251 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Fabio M. Di Nitto 2009-06-18 05:33:48 +00:00
parent 6d5ce092a1
commit ad4a6c63ea

View File

@ -189,6 +189,8 @@ void *logsys_rec_end;
#define FDTAIL_INDEX (flt_data_size + 1)
#define FDMAX_ARGS 64
/* forward declarations */
static void logsys_close_logfile(int subsysid);
@ -619,7 +621,7 @@ static void record_print (const char *buf)
unsigned int i;
unsigned int words_processed;
unsigned int arg_size_idx;
const void *arguments[64];
const void *arguments[FDMAX_ARGS];
unsigned int arg_count;
arg_size_idx = 4;
@ -1088,18 +1090,16 @@ void _logsys_log_rec (
...)
{
va_list ap;
const void *buf_args[64];
unsigned int buf_len[64];
const void *buf_args[FDMAX_ARGS];
unsigned int buf_len[FDMAX_ARGS];
unsigned int i;
unsigned int idx;
unsigned int arguments = 0;
unsigned int record_reclaim_size;
unsigned int record_reclaim_size = 0;
unsigned int index_start;
int words_written;
int subsysid;
record_reclaim_size = 0;
subsysid = LOGSYS_DECODE_SUBSYSID(rec_ident);
/*
@ -1115,7 +1115,7 @@ void _logsys_log_rec (
buf_len[arguments] = va_arg (ap, int);
record_reclaim_size += ((buf_len[arguments] + 3) >> 2) + 1;
arguments++;
if (arguments >= 64) {
if (arguments >= FDMAX_ARGS) {
break;
}
}