Mon Oct 23 14:57:01 PDT 2006
- Previous message: [Slony1-commit] By cbbrowne: Three changes: 1.
- Next message: [Slony1-commit] By cbbrowne: Add #define of MAXGROUPSIZE (100, in version 1.1) Allocate
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message: ----------- Three changes: 1. Allocate an extra entry in sync_group - SlonWorkMsg_event *sync_group[MAXGROUPSIZE+1]; That way, we can get the value of sync_group_size all the way to MAXGROUPSIZE and not blow out the end of the array. 2. Add into the while loop that increments sync_group_size a check that we haven't exceeded MAXGROUPSIZE. That way we won't blow past the end of the array if next_sync_group_size gets set too high. 3. Logic for processing return code from fclose() treats "nonzero" as the error condition as per H&S Section 15.2 Tags: ---- REL_1_2_STABLE Modified Files: -------------- slony1-engine/src/slon: remote_worker.c (r1.124 -> r1.124.2.1) -------------- next part -------------- Index: remote_worker.c =================================================================== RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/remote_worker.c,v retrieving revision 1.124 retrieving revision 1.124.2.1 diff -Lsrc/slon/remote_worker.c -Lsrc/slon/remote_worker.c -u -w -r1.124 -r1.124.2.1 --- src/slon/remote_worker.c +++ src/slon/remote_worker.c @@ -463,7 +463,7 @@ */ if (strcmp(event->ev_type, "SYNC") == 0) { - SlonWorkMsg_event *sync_group[MAXGROUPSIZE]; + SlonWorkMsg_event *sync_group[MAXGROUPSIZE+1]; int sync_group_size; int seconds; @@ -544,7 +544,7 @@ gettimeofday(&sync_start, NULL); pthread_mutex_lock(&(node->message_lock)); - while (sync_group_size < next_sync_group_size && node->message_head != NULL) + while (sync_group_size < next_sync_group_size && sync_group_size < MAXGROUPSIZE && node->message_head != NULL) { if (node->message_head->msg_type != WMSG_EVENT) break; @@ -5827,7 +5827,7 @@ return -1; rc = fclose(archive_fp); archive_fp = NULL; - if (rc < 0) + if (rc != 0) return -1; rc = rename(archive_tmp, archive_name); }
- Previous message: [Slony1-commit] By cbbrowne: Three changes: 1.
- Next message: [Slony1-commit] By cbbrowne: Add #define of MAXGROUPSIZE (100, in version 1.1) Allocate
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list