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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 *
14
14
 *
15
15
 * IDENTIFICATION
16
 
 *        $PostgreSQL: pgsql/src/backend/storage/ipc/ipc.c,v 1.103 2009/05/05 20:06:07 tgl Exp $
 
16
 *        $PostgreSQL: pgsql/src/backend/storage/ipc/ipc.c,v 1.105 2009/06/11 14:49:01 momjian Exp $
17
17
 *
18
18
 *-------------------------------------------------------------------------
19
19
 */
83
83
 *              -cim 2/6/90
84
84
 *
85
85
 *              Unfortunately, we can't really guarantee that add-on code
86
 
 *              obeys the rule of not calling exit() directly.  So, while
 
86
 *              obeys the rule of not calling exit() directly.  So, while
87
87
 *              this is the preferred way out of the system, we also register
88
88
 *              an atexit callback that will make sure cleanup happens.
89
89
 * ----------------------------------------------------------------
113
113
                 *
114
114
                 * Note that we do this here instead of in an on_proc_exit() callback
115
115
                 * because we want to ensure that this code executes last - we don't
116
 
                 * want to interfere with any other on_proc_exit() callback.  For
117
 
                 * the same reason, we do not include it in proc_exit_prepare ...
118
 
                 * so if you are exiting in the "wrong way" you won't drop your profile
119
 
                 * in a nice place.
 
116
                 * want to interfere with any other on_proc_exit() callback.  For the
 
117
                 * same reason, we do not include it in proc_exit_prepare ... so if
 
118
                 * you are exiting in the "wrong way" you won't drop your profile in a
 
119
                 * nice place.
120
120
                 */
121
121
                char            gprofDirName[32];
122
122
 
166
166
        /* do our shared memory exits first */
167
167
        shmem_exit(code);
168
168
 
169
 
        elog(DEBUG3, "proc_exit(%d)", code);
 
169
        elog(DEBUG3, "proc_exit(%d): %d callbacks to make",
 
170
                 code, on_proc_exit_index);
170
171
 
171
172
        /*
172
173
         * call all the registered callbacks.
193
194
void
194
195
shmem_exit(int code)
195
196
{
196
 
        elog(DEBUG3, "shmem_exit(%d)", code);
 
197
        elog(DEBUG3, "shmem_exit(%d): %d callbacks to make",
 
198
                 code, on_shmem_exit_index);
197
199
 
198
200
        /*
199
201
         * call all the registered callbacks.
227
229
        /* ... too bad we don't know the real exit code ... */
228
230
        proc_exit_prepare(-1);
229
231
}
230
 
 
231
 
#else  /* assume we have on_exit instead */
 
232
#else                                                   /* assume we have on_exit instead */
232
233
 
233
234
static void
234
235
atexit_callback(int exitstatus, void *arg)
236
237
        /* Clean up everything that must be cleaned up */
237
238
        proc_exit_prepare(exitstatus);
238
239
}
239
 
 
240
 
#endif /* HAVE_ATEXIT */
 
240
#endif   /* HAVE_ATEXIT */
241
241
 
242
242
/* ----------------------------------------------------------------
243
243
 *              on_proc_exit