|
@@ -18,9 +18,9 @@
|
|
|
|
|
|
|
|
#include <corosync/engine/logsys.h>
|
|
#include <corosync/engine/logsys.h>
|
|
|
|
|
|
|
|
-unsigned int flt_data_size;
|
|
|
|
|
|
|
+uint32_t flt_data_size;
|
|
|
|
|
|
|
|
-unsigned int *flt_data;
|
|
|
|
|
|
|
+uint32_t *flt_data;
|
|
|
#define FDHEAD_INDEX (flt_data_size)
|
|
#define FDHEAD_INDEX (flt_data_size)
|
|
|
#define FDTAIL_INDEX (flt_data_size + 1)
|
|
#define FDTAIL_INDEX (flt_data_size + 1)
|
|
|
|
|
|
|
@@ -343,13 +343,13 @@ static unsigned int printer_subsys_count =
|
|
|
|
|
|
|
|
#define G_RECORD_SIZE 10000
|
|
#define G_RECORD_SIZE 10000
|
|
|
|
|
|
|
|
-static unsigned int g_record[G_RECORD_SIZE];
|
|
|
|
|
|
|
+static uint32_t g_record[G_RECORD_SIZE];
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
* Copy record, dealing with wrapping
|
|
* Copy record, dealing with wrapping
|
|
|
*/
|
|
*/
|
|
|
static int logsys_rec_get (int rec_idx) {
|
|
static int logsys_rec_get (int rec_idx) {
|
|
|
- unsigned int rec_size;
|
|
|
|
|
|
|
+ uint32_t rec_size;
|
|
|
int firstcopy, secondcopy;
|
|
int firstcopy, secondcopy;
|
|
|
|
|
|
|
|
rec_size = flt_data[rec_idx];
|
|
rec_size = flt_data[rec_idx];
|
|
@@ -366,25 +366,25 @@ static int logsys_rec_get (int rec_idx) {
|
|
|
firstcopy = flt_data_size - rec_idx;
|
|
firstcopy = flt_data_size - rec_idx;
|
|
|
secondcopy -= firstcopy - rec_size;
|
|
secondcopy -= firstcopy - rec_size;
|
|
|
}
|
|
}
|
|
|
- memcpy (&g_record[0], &flt_data[rec_idx], firstcopy<<2);
|
|
|
|
|
|
|
+ memcpy (&g_record[0], &flt_data[rec_idx], firstcopy * sizeof(uint32_t));
|
|
|
if (secondcopy) {
|
|
if (secondcopy) {
|
|
|
- memcpy (&g_record[firstcopy], &flt_data[0], secondcopy<<2);
|
|
|
|
|
|
|
+ memcpy (&g_record[firstcopy], &flt_data[0], secondcopy * sizeof(uint32_t));
|
|
|
}
|
|
}
|
|
|
return ((rec_idx + rec_size) % flt_data_size);
|
|
return ((rec_idx + rec_size) % flt_data_size);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void logsys_rec_print (const void *record)
|
|
static void logsys_rec_print (const void *record)
|
|
|
{
|
|
{
|
|
|
- const unsigned int *buf_uint32t = record;
|
|
|
|
|
- unsigned int rec_size;
|
|
|
|
|
- unsigned int rec_ident;
|
|
|
|
|
- unsigned int level;
|
|
|
|
|
- unsigned int line;
|
|
|
|
|
- unsigned int arg_size_idx;
|
|
|
|
|
|
|
+ const uint32_t *buf_uint32t = record;
|
|
|
|
|
+ uint32_t rec_size;
|
|
|
|
|
+ uint32_t rec_ident;
|
|
|
|
|
+ uint32_t level;
|
|
|
|
|
+ uint32_t line;
|
|
|
|
|
+ uint32_t arg_size_idx;
|
|
|
unsigned int i;
|
|
unsigned int i;
|
|
|
unsigned int j;
|
|
unsigned int j;
|
|
|
unsigned int rec_idx = 0;
|
|
unsigned int rec_idx = 0;
|
|
|
- unsigned int record_number;
|
|
|
|
|
|
|
+ uint32_t record_number;
|
|
|
unsigned int words_processed;
|
|
unsigned int words_processed;
|
|
|
unsigned int found;
|
|
unsigned int found;
|
|
|
const char *arguments[64];
|
|
const char *arguments[64];
|
|
@@ -480,14 +480,14 @@ int main (void)
|
|
|
return EXIT_FAILURE;
|
|
return EXIT_FAILURE;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- n_required = sizeof (unsigned int);
|
|
|
|
|
|
|
+ n_required = sizeof (uint32_t);
|
|
|
n_read = read (fd, &flt_data_size, n_required);
|
|
n_read = read (fd, &flt_data_size, n_required);
|
|
|
if (n_read != n_required) {
|
|
if (n_read != n_required) {
|
|
|
fprintf (stderr, "Unable to read fdata header\n");
|
|
fprintf (stderr, "Unable to read fdata header\n");
|
|
|
return EXIT_FAILURE;
|
|
return EXIT_FAILURE;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- n_required = ((flt_data_size + 2) * sizeof(unsigned int));
|
|
|
|
|
|
|
+ n_required = ((flt_data_size + 2) * sizeof(uint32_t));
|
|
|
|
|
|
|
|
if ((flt_data = malloc (n_required)) == NULL) {
|
|
if ((flt_data = malloc (n_required)) == NULL) {
|
|
|
fprintf (stderr, "exhausted virtual memory\n");
|
|
fprintf (stderr, "exhausted virtual memory\n");
|