svn commit: r272760 - in stable/9: contrib/libc-vis etc/rc.d sbin/devd share/man/man4 tools/tools/sysdoc
Brooks Davis
brooks at FreeBSD.org
Wed Oct 8 16:35:59 UTC 2014
Author: brooks
Date: Wed Oct 8 16:35:57 2014
New Revision: 272760
URL: https://svnweb.freebsd.org/changeset/base/272760
Log:
Revert botched r272755.
PR: 193447
Modified:
stable/9/contrib/libc-vis/vis.c
stable/9/etc/rc.d/devd
stable/9/sbin/devd/devd.cc
stable/9/share/man/man4/devctl.4
stable/9/tools/tools/sysdoc/tunables.mdoc
Directory Properties:
stable/9/ (props changed)
stable/9/contrib/libc-vis/ (props changed)
stable/9/etc/ (props changed)
stable/9/etc/rc.d/ (props changed)
stable/9/sbin/ (props changed)
stable/9/sbin/devd/ (props changed)
stable/9/share/ (props changed)
stable/9/share/man/ (props changed)
stable/9/share/man/man4/ (props changed)
stable/9/tools/ (props changed)
stable/9/tools/tools/ (props changed)
stable/9/tools/tools/sysdoc/ (props changed)
Modified: stable/9/contrib/libc-vis/vis.c
==============================================================================
--- stable/9/contrib/libc-vis/vis.c Wed Oct 8 16:32:01 2014 (r272759)
+++ stable/9/contrib/libc-vis/vis.c Wed Oct 8 16:35:57 2014 (r272760)
@@ -1,4 +1,4 @@
-/* $NetBSD: vis.c,v 1.62 2014/09/08 17:35:01 christos Exp $ */
+/* $NetBSD: vis.c,v 1.60 2013/02/21 16:21:20 joerg Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -57,7 +57,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: vis.c,v 1.62 2014/09/08 17:35:01 christos Exp $");
+__RCSID("$NetBSD: vis.c,v 1.60 2013/02/21 16:21:20 joerg Exp $");
#endif /* LIBC_SCCS and not lint */
#ifdef __FBSDID
__FBSDID("$FreeBSD$");
@@ -357,7 +357,7 @@ istrsenvisx(char *mbdst, size_t *dlen, c
ssize_t mbslength, maxolen;
_DIAGASSERT(mbdst != NULL);
- _DIAGASSERT(mbsrc != NULL || mblength == 0);
+ _DIAGASSERT(mbsrc != NULL);
_DIAGASSERT(mbextra != NULL);
/*
@@ -375,6 +375,8 @@ istrsenvisx(char *mbdst, size_t *dlen, c
/* Allocate space for the wide char strings */
psrc = pdst = extra = NULL;
+ if (!mblength)
+ mblength = strlen(mbsrc);
if ((psrc = calloc(mblength + 1, sizeof(*psrc))) == NULL)
return -1;
if ((pdst = calloc((4 * mblength) + 1, sizeof(*pdst))) == NULL)
@@ -526,15 +528,6 @@ out:
free(psrc);
return error;
}
-
-static int
-istrsenvisxl(char *mbdst, size_t *dlen, const char *mbsrc,
- int flags, const char *mbextra, int *cerr_ptr)
-{
- return istrsenvisx(mbdst, dlen, mbsrc,
- mbsrc != NULL ? strlen(mbsrc) : 0, flags, mbextra, cerr_ptr);
-}
-
#endif
#if !HAVE_SVIS
@@ -578,13 +571,13 @@ snvis(char *mbdst, size_t dlen, int c, i
int
strsvis(char *mbdst, const char *mbsrc, int flags, const char *mbextra)
{
- return istrsenvisxl(mbdst, NULL, mbsrc, flags, mbextra, NULL);
+ return istrsenvisx(mbdst, NULL, mbsrc, 0, flags, mbextra, NULL);
}
int
strsnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags, const char *mbextra)
{
- return istrsenvisxl(mbdst, &dlen, mbsrc, flags, mbextra, NULL);
+ return istrsenvisx(mbdst, &dlen, mbsrc, 0, flags, mbextra, NULL);
}
int
@@ -653,13 +646,13 @@ nvis(char *mbdst, size_t dlen, int c, in
int
strvis(char *mbdst, const char *mbsrc, int flags)
{
- return istrsenvisxl(mbdst, NULL, mbsrc, flags, "", NULL);
+ return istrsenvisx(mbdst, NULL, mbsrc, 0, flags, "", NULL);
}
int
strnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags)
{
- return istrsenvisxl(mbdst, &dlen, mbsrc, flags, "", NULL);
+ return istrsenvisx(mbdst, &dlen, mbsrc, 0, flags, "", NULL);
}
/*
Modified: stable/9/etc/rc.d/devd
==============================================================================
--- stable/9/etc/rc.d/devd Wed Oct 8 16:32:01 2014 (r272759)
+++ stable/9/etc/rc.d/devd Wed Oct 8 16:35:57 2014 (r272760)
@@ -30,10 +30,9 @@ devd_prestart ()
{
find_pidfile
- # If devd is disabled, turn it off in the kernel to avoid unnecessary
- # memory usage.
+ # If devd is disabled, turn it off in the kernel to avoid memory leaks.
if ! checkyesno ${rcvar}; then
- $SYSCTL hw.bus.devctl_queue=0
+ $SYSCTL hw.bus.devctl_disable=1
fi
}
Modified: stable/9/sbin/devd/devd.cc
==============================================================================
--- stable/9/sbin/devd/devd.cc Wed Oct 8 16:32:01 2014 (r272759)
+++ stable/9/sbin/devd/devd.cc Wed Oct 8 16:35:57 2014 (r272760)
@@ -99,7 +99,7 @@ __FBSDID("$FreeBSD$");
#define PIPE "/var/run/devd.pipe"
#define CF "/etc/devd.conf"
-#define SYSCTL "hw.bus.devctl_queue"
+#define SYSCTL "hw.bus.devctl_disable"
/*
* Since the client socket is nonblocking, we must increase its send buffer to
@@ -1119,9 +1119,9 @@ check_devd_enabled()
len = sizeof(val);
if (sysctlbyname(SYSCTL, &val, &len, NULL, 0) != 0)
errx(1, "devctl sysctl missing from kernel!");
- if (val == 0) {
- warnx("Setting " SYSCTL " to 1000");
- val = 1000;
+ if (val) {
+ warnx("Setting " SYSCTL " to 0");
+ val = 0;
sysctlbyname(SYSCTL, NULL, NULL, &val, sizeof(val));
}
}
Modified: stable/9/share/man/man4/devctl.4
==============================================================================
--- stable/9/share/man/man4/devctl.4 Wed Oct 8 16:32:01 2014 (r272759)
+++ stable/9/share/man/man4/devctl.4 Wed Oct 8 16:35:57 2014 (r272760)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 26, 2014
+.Dd February 11, 2003
.Dt DEVCTL 4
.Os
.Sh NAME
@@ -73,9 +73,9 @@ If you try to read this device a charact
the rest of the data.
Listening programs are expected to cope.
.Pp
-The sysctl
-.Va hw.bus.devctl_queue
-can be used to control queue length. It is set to 0 to disable
+The sysctl and boot parameter
+.Va hw.bus.devctl_disable
+is used to disable
.Nm
when no
.Xr devd 8
Modified: stable/9/tools/tools/sysdoc/tunables.mdoc
==============================================================================
--- stable/9/tools/tools/sysdoc/tunables.mdoc Wed Oct 8 16:32:01 2014 (r272759)
+++ stable/9/tools/tools/sysdoc/tunables.mdoc Wed Oct 8 16:35:57 2014 (r272760)
@@ -233,6 +233,16 @@ See
for more information.
---
+hw.bus.devctl_disable
+bool
+
+This can be used to turn off
+.Xr devctl 4
+when no
+.Xr devd 8
+is running.
+
+---
hw.bus.devices
---
More information about the svn-src-stable-9
mailing list