diff options
| author | Glen Barber <gjb@FreeBSD.org> | 2016-02-03 02:02:01 +0000 |
|---|---|---|
| committer | Glen Barber <gjb@FreeBSD.org> | 2016-02-03 02:02:01 +0000 |
| commit | 3bea1c132c1898be41804ede46dd1a6f8c4a58f7 (patch) | |
| tree | 85ff5948d73233a0bc8c10d4dd2f88832a8d06b9 /lib | |
| parent | a1c8ecf437d7a26a1c0765c73b90dd881eb833a8 (diff) | |
| parent | a4d64816be464b7d128ad417180db15cfe416f0d (diff) | |
MFH
Sponsored by: The FreeBSD Foundation
Notes
svn path=/projects/release-pkg/; revision=295189
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/nls/msgcat.c | 26 | ||||
| -rw-r--r-- | lib/libdevctl/devctl.3 | 9 |
2 files changed, 22 insertions, 13 deletions
diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c index 0cba460403b3..3df76b60b4bd 100644 --- a/lib/libc/nls/msgcat.c +++ b/lib/libc/nls/msgcat.c @@ -325,6 +325,21 @@ notfound: return ((char *)s); } +static void +catfree(struct catentry *np) +{ + + if (np->catd != NULL && np->catd != NLERR) { + munmap(np->catd->__data, (size_t)np->catd->__size); + free(np->catd); + } + SLIST_REMOVE(&cache, np, catentry, list); + free(np->name); + free(np->path); + free(np->lang); + free(np); +} + int catclose(nl_catd catd) { @@ -341,15 +356,8 @@ catclose(nl_catd catd) SLIST_FOREACH(np, &cache, list) { if (catd == np->catd) { np->refcount--; - if (np->refcount == 0) { - munmap(catd->__data, (size_t)catd->__size); - free(catd); - SLIST_REMOVE(&cache, np, catentry, list); - free(np->name); - free(np->path); - free(np->lang); - free(np); - } + if (np->refcount == 0) + catfree(np); break; } } diff --git a/lib/libdevctl/devctl.3 b/lib/libdevctl/devctl.3 index be869f9d9868..b2734cf4aa30 100644 --- a/lib/libdevctl/devctl.3 +++ b/lib/libdevctl/devctl.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 26, 2014 +.Dd February 2, 2016 .Dt DEVCTL 3 .Os .Sh NAME @@ -35,6 +35,7 @@ .Nm devctl_disable , .Nm devctl_enable , .Nm devctl_resume , +.Nm devctl_set_driver , .Nm devctl_suspend .Nd device control library .Sh LIBRARY @@ -52,9 +53,9 @@ .Ft int .Fn devctl_resume "const char *device" .Ft int -.Fn devctl_suspend "const char *device" -.Ft int .Fn devctl_set_driver "const char *device" "const char *driver" "bool force" +.Ft int +.Fn devctl_suspend "const char *device" .Sh DESCRIPTION The .Nm @@ -287,7 +288,7 @@ The new device driver failed to attach. The .Nm library first appeared in -.Fx 11.0 . +.Fx 10.3 . .Sh BUGS If a device is suspended individually via .Fn devctl_suspend |
