uint32_t *old_counters;
- printf("Counters: ");
+ printf("[%4u] Counters: ", getpid());
old_counters = (uint32_t *)old_data.dptr;
for (i=0;i<old_data.dsize/sizeof(uint32_t); i++) {
printf("%6u ", old_counters[i]);
/* check that all the counters are monotonic increasing */
for (i=0; i<old_data.dsize/sizeof(uint32_t); i++) {
if (counters[i]<old_counters[i]) {
- printf("ERROR: counters has decreased for node %u From %u to %u\n", i, old_counters[i], counters[i]);
+ printf("[%4u] ERROR: counters has decreased for node %u From %u to %u\n",
+ getpid(), i, old_counters[i], counters[i]);
success = false;
}
}
int ret;
struct ctdb_record_handle *h;
uint32_t *counters;
- int first_time = true;
ctdb_db = ctdb_db_handle(ctdb, "persistent.tdb");
key.dptr = discard_const("testkey");
counters = (uint32_t *)data.dptr;
- if (first_time) {
- counters[pnn] = 0;
- first_time = false;
- }
-
/* bump our counter */
counters[pnn]++;
poptContext pc;
struct event_context *ev;
+ setlinebuf(stdout);
+
pc = poptGetContext(argv[0], argc, argv, popt_options, POPT_CONTEXT_KEEP_FIRST);
while ((opt = poptGetNextOpt(pc)) != -1) {