aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-08-05 11:21:01 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2013-08-05 11:21:01 +0300
commit76d9b5d569c7d0ac8e4b65ed63b6afa5a7999f90 (patch)
treed48cd4056aadfadb5489e64521032a6343e9e54d
parent73f605f76d82aec40a7f1bbd309e2097d9abfd42 (diff)
downloadvmod-tbf-76d9b5d569c7d0ac8e4b65ed63b6afa5a7999f90.tar.gz
vmod-tbf-76d9b5d569c7d0ac8e4b65ed63b6afa5a7999f90.tar.bz2
Minor change
* src/getla.c: Move system-dependent part into a separate function.
-rw-r--r--src/getla.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/getla.c b/src/getla.c
index 75d229b..c735956 100644
--- a/src/getla.c
+++ b/src/getla.c
@@ -25,23 +25,9 @@
#include "vrt.h"
#include "vcc_if.h"
-double
-vmod_getla(struct sess *sp, int what)
+static double
+sys_getla(int what)
{
- switch (what) {
- case 1:
- what = 0;
- break;
- case 5:
- what = 1;
- break;
- case 15:
- what = 2;
- break;
- default:
- what = 0;
- }
-
#if defined(HAVE_GETLOADAVG)
double loadavg[3];
@@ -63,3 +49,22 @@ vmod_getla(struct sess *sp, int what)
return 0.0;
#endif
}
+
+double
+vmod_getla(struct sess *sp, int what)
+{
+ switch (what) {
+ case 1:
+ what = 0;
+ break;
+ case 5:
+ what = 1;
+ break;
+ case 15:
+ what = 2;
+ break;
+ default:
+ what = 0;
+ }
+ return sys_getla(what);
+}

Return to:

Send suggestions and report system problems to the System administrator.