diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-08-17 12:06:19 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-08-17 12:06:19 +0000 |
| commit | 037c3d0fb035be10ead8afeed05d6d90fd46021e (patch) | |
| tree | eb57ac4ae044c7ed701ab8c7014376f24c5f26c7 | |
| parent | 96316581fcac8dbddbe743a1096b1ca895182db8 (diff) | |
Notes
| -rw-r--r-- | sys/kern/subr_devstat.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/subr_devstat.c b/sys/kern/subr_devstat.c index f7a52ffebaef..6a51745aa263 100644 --- a/sys/kern/subr_devstat.c +++ b/sys/kern/subr_devstat.c @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include <machine/atomic.h> static int devstat_num_devs; -static long devstat_generation; +static long devstat_generation = 1; static int devstat_version = DEVSTAT_VERSION; static int devstat_current_devnumber; static struct mtx devstat_mutex; @@ -364,9 +364,6 @@ sysctl_devstat(SYSCTL_HANDLER_ARGS) mtx_assert(&devstat_mutex, MA_NOTOWNED); - if (devstat_num_devs == 0) - return(EINVAL); - /* * XXX devstat_generation should really be "volatile" but that * XXX freaks out the sysctl macro below. The places where we @@ -379,6 +376,9 @@ sysctl_devstat(SYSCTL_HANDLER_ARGS) error = SYSCTL_OUT(req, &mygen, sizeof(mygen)); + if (devstat_num_devs == 0) + return(0); + if (error != 0) return (error); |
