Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/lib/libumem In NetBSD pool cache constru...



details:   https://anonhg.NetBSD.org/src/rev/5a3f22bbb973
branches:  trunk
changeset: 754521:5a3f22bbb973
user:      haad <haad%NetBSD.org@localhost>
date:      Sun May 02 23:59:54 2010 +0000

description:
In NetBSD pool cache constructor/destructor routines has inverted arguments.

C

diffstat:

 external/cddl/osnet/lib/libumem/umem.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r e47049e85fb7 -r 5a3f22bbb973 external/cddl/osnet/lib/libumem/umem.c
--- a/external/cddl/osnet/lib/libumem/umem.c    Sun May 02 23:50:34 2010 +0000
+++ b/external/cddl/osnet/lib/libumem/umem.c    Sun May 02 23:59:54 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umem.c,v 1.1 2009/08/07 20:57:56 haad Exp $    */
+/*     $NetBSD: umem.c,v 1.2 2010/05/02 23:59:54 haad Exp $    */
 
 /*
  * CDDL HEADER START
@@ -135,7 +135,8 @@
        }
 
        if(cache->constructor != NULL) {
-               if(cache->constructor(buf, cache->callback_data, flags) != 0) {
+               /* XXX NetBSD pool cache costructor has switched arguments. */
+               if(cache->constructor(cache->callback_data, buf, flags) != 0) {
                        free(buf);
                        if(!(flags & UMEM_NOFAIL))
                                return NULL;
@@ -155,7 +156,8 @@
 void umem_cache_free(umem_cache_t *cache, void *buffer)
 {
        if(cache->destructor != NULL)
-               cache->destructor(buffer, cache->callback_data);
+               /* XXX NetBSD pool cache costructor has switched arguments. */
+               cache->destructor(cache->callback_data, buffer);
 
        free(buffer);
 }



Home | Main Index | Thread Index | Old Index