~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

Viewing changes to src/backend/storage/ipc/pmsignal.c

Tags: upstream-8.4.0
ImportĀ upstreamĀ versionĀ 8.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 * Portions Copyright (c) 1994, Regents of the University of California
9
9
 *
10
10
 * IDENTIFICATION
11
 
 *        $PostgreSQL: pgsql/src/backend/storage/ipc/pmsignal.c,v 1.27 2009/05/05 19:59:00 tgl Exp $
 
11
 *        $PostgreSQL: pgsql/src/backend/storage/ipc/pmsignal.c,v 1.28 2009/06/11 14:49:01 momjian Exp $
12
12
 *
13
13
 *-------------------------------------------------------------------------
14
14
 */
41
41
 * have three possible states: UNUSED, ASSIGNED, ACTIVE.  An UNUSED slot is
42
42
 * available for assignment.  An ASSIGNED slot is associated with a postmaster
43
43
 * child process, but either the process has not touched shared memory yet,
44
 
 * or it has successfully cleaned up after itself.  A ACTIVE slot means the
 
44
 * or it has successfully cleaned up after itself.      A ACTIVE slot means the
45
45
 * process is actively using shared memory.  The slots are assigned to
46
46
 * child processes at random, and postmaster.c is responsible for tracking
47
47
 * which one goes with which PID.
57
57
        /* per-reason flags */
58
58
        sig_atomic_t PMSignalFlags[NUM_PMSIGNALS];
59
59
        /* per-child-process flags */
60
 
        int                     num_child_flags;                /* # of entries in PMChildFlags[] */
61
 
        int                     next_child_flag;                /* next slot to try to assign */
 
60
        int                     num_child_flags;        /* # of entries in PMChildFlags[] */
 
61
        int                     next_child_flag;        /* next slot to try to assign */
62
62
        sig_atomic_t PMChildFlags[1];           /* VARIABLE LENGTH ARRAY */
63
63
};
64
64
 
181
181
 
182
182
        Assert(slot > 0 && slot <= PMSignalState->num_child_flags);
183
183
        slot--;
 
184
 
184
185
        /*
185
186
         * Note: the slot state might already be unused, because the logic in
186
187
         * postmaster.c is such that this might get called twice when a child