striker 01/07/04 17:41:12
Modified: include apr_sms.h
memory/unix apr_sms.c
Log:
We seemed to have jumped the gun a bit in a previous commit. The problem
we saw was fixed, but with the previous patch we lost functionality.
Putting that back in.
Revision Changes Path
1.30 +4 -3 apr/include/apr_sms.h
Index: apr_sms.h
===================================================================
RCS file: /home/cvs/apr/include/apr_sms.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- apr_sms.h 2001/07/04 22:11:42 1.29
+++ apr_sms.h 2001/07/05 00:41:11 1.30
@@ -79,6 +79,7 @@
**********************************************************************/
/* The various types of cleanup's we can offer */
+#define APR_ALL_CLEANUPS 0x0000
#define APR_GENERAL_CLEANUP 0x0001
#define APR_CHILD_CLEANUP 0x0002
@@ -87,7 +88,7 @@
* APR_ALIGN is only to be used to align on a power of 2 boundary
*/
#define APR_ALIGN(size, boundary) \
- (((size) + ((boundary) - 1)) & ~ ((boundary) -1))
+ (((size) + ((boundary) - 1)) & ~((boundary) - 1))
#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
@@ -109,7 +110,7 @@
* using the APR_DEBUG_FILE define. Normally this is set to setdout
* and the output is simply printed there.
*/
-#define APR_DEBUG_TO_FILE 0
+#define APR_DEBUG_TO_FILE 0
#define APR_DEBUG_FILE "/tmp/sms_debug"
/* APR_DEBUG_SHOW_STRUCTURE
@@ -403,7 +404,7 @@
* @param tag The tag to give the sms
* @param sms The sms to apply the tag to
*/
-APR_DECLARE(void) apr_sms_tag(const char*tag, apr_sms_t *sms);
+APR_DECLARE(void) apr_sms_tag(const char *tag, apr_sms_t *sms);
#endif /* APR_DEBUG_TAG_SMS */
#ifdef __cplusplus
1.40 +4 -4 apr/memory/unix/apr_sms.c
Index: apr_sms.c
===================================================================
RCS file: /home/cvs/apr/memory/unix/apr_sms.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- apr_sms.c 2001/07/04 22:11:44 1.39
+++ apr_sms.c 2001/07/05 00:41:12 1.40
@@ -397,7 +397,7 @@
static void apr_sms_do_cleanups(struct apr_sms_cleanup *c)
{
while (c) {
- if (c->type == APR_GENERAL_CLEANUP) {
+ if (c->type == APR_ALL_CLEANUPS || c->type == APR_GENERAL_CLEANUP) {
c->cleanup_fn(c->data);
}
c = c->next;
@@ -727,7 +727,7 @@
cleanup = sms->cleanups;
cleanup_ref = &sms->cleanups;
while (cleanup) {
- if (cleanup->type == type &&
+ if ((type == APR_ALL_CLEANUPS || cleanup->type == type) &&
cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) {
*cleanup_ref = cleanup->next;
@@ -765,7 +765,7 @@
cleanup_ref = &sms->cleanups;
sms = sms->accounting;
while (cleanup) {
- if (cleanup->type == type) {
+ if (type == APR_ALL_CLEANUPS || cleanup->type == type) {
*cleanup_ref = cleanup->next;
if (sms->free_fn)
@@ -816,7 +816,7 @@
cleanup_ref = &sms->cleanups;
sms = sms->accounting;
while (cleanup) {
- if (cleanup->type == type) {
+ if (type == APR_ALL_CLEANUPS || cleanup->type == type) {
*cleanup_ref = cleanup->next;
cleanup->cleanup_fn(cleanup->data);