]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__db_rdetach): Unmap the region if necessary.
authorUlrich Drepper <drepper@redhat.com>
Sun, 5 Sep 1999 23:30:54 +0000 (23:30 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 5 Sep 1999 23:30:54 +0000 (23:30 +0000)
db2/common/db_region.c

index 284af6176a72860edc728eef046dd81c573439fd..4542fcf5d2e8f2dd19621b063c84c66b96cd6641 100644 (file)
@@ -507,8 +507,18 @@ __db_rdetach(infop)
         * If the region was removed when it was created, no further action
         * is required.
         */
-       if (F_ISSET(infop, REGION_REMOVED))
+       if (F_ISSET(infop, REGION_REMOVED)) {
+               if (F_ISSET(infop, REGION_PRIVATE)
+                   && !F_ISSET(infop, REGION_MALLOC))
+                       /*
+                        * If it is private and not malloced, the
+                        * region is still mapped in. We need to
+                        * discard our mapping of the region.
+                        */
+                       ret = __db_unmapregion(infop);
                goto done;
+       }
+
        /*
         * If the region was created in memory returned by malloc, the only
         * action required is freeing the memory.