striker 01/07/05 16:32:51
Modified: include apr_sms.h
memory/unix apr_sms.c
Log:
Added a cleanup type check that was missed earlier on.
Swapped the arguments to apr_sms_tag. The sms is now the
first argument, like in the rest of the functions.
Revision Changes Path
1.31 +1 -1 apr/include/apr_sms.h
Index: apr_sms.h
===================================================================
RCS file: /home/cvs/apr/include/apr_sms.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- apr_sms.h 2001/07/05 00:41:11 1.30
+++ apr_sms.h 2001/07/05 23:32:48 1.31
@@ -404,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(apr_sms_t *sms, const char *tag);
#endif /* APR_DEBUG_TAG_SMS */
#ifdef __cplusplus
1.41 +7 -6 apr/memory/unix/apr_sms.c
Index: apr_sms.c
===================================================================
RCS file: /home/cvs/apr/memory/unix/apr_sms.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- apr_sms.c 2001/07/05 00:41:12 1.40
+++ apr_sms.c 2001/07/05 23:32:50 1.41
@@ -564,7 +564,9 @@
cleanup = sms->cleanups;
while (cleanup) {
- cleanup->cleanup_fn(cleanup->data);
+ if (cleanup->type == APR_GENERAL_CLEANUP)
+ cleanup->cleanup_fn(cleanup->data);
+
next_cleanup = cleanup->next;
apr_sms_free(sms->accounting, cleanup);
cleanup = next_cleanup;
@@ -688,13 +690,12 @@
if (sms->sms_lock)
apr_lock_acquire(sms->sms_lock);
- cleanup = (struct apr_sms_cleanup *)
- apr_sms_malloc(sms->accounting,
- sizeof(struct apr_sms_cleanup));
+ cleanup = apr_sms_malloc(sms->accounting, sizeof(struct
apr_sms_cleanup));
- if (!cleanup){
+ if (!cleanup) {
if (sms->sms_lock)
apr_lock_release(sms->sms_lock);
+
return APR_ENOMEM;
}
@@ -1021,7 +1022,7 @@
#endif /* APR_DEBUG_SHOW_STRUCTURE */
#if APR_DEBUG_TAG_SMS
-APR_DECLARE(void) apr_sms_tag(const char *tag, apr_sms_t *sms)
+APR_DECLARE(void) apr_sms_tag(apr_sms_t *sms, const char *tag)
{
sms->tag = tag;
}