projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
code clean up
[oweals/gnunet.git]
/
src
/
util
/
os_load.c
diff --git
a/src/util/os_load.c
b/src/util/os_load.c
index a25331effe5ab9e02f5b65d7a597bf5bf134a90c..f7b5dff96c96dfd7dd3297ce2f12c53ba74b3d77 100644
(file)
--- a/
src/util/os_load.c
+++ b/
src/util/os_load.c
@@
-603,6
+603,8
@@
GNUNET_OS_load_cpu_get (const struct GNUNET_CONFIGURATION_Handle *cfg)
GNUNET_CONFIGURATION_get_value_number (cfg, "LOAD", "MAXCPULOAD",
&maxCPULoad))
return GNUNET_SYSERR;
GNUNET_CONFIGURATION_get_value_number (cfg, "LOAD", "MAXCPULOAD",
&maxCPULoad))
return GNUNET_SYSERR;
+ if (maxCPULoad == 0)
+ return 100;
return (100 * ret) / maxCPULoad;
}
return (100 * ret) / maxCPULoad;
}
@@
-626,6
+628,8
@@
GNUNET_OS_load_disk_get (const struct GNUNET_CONFIGURATION_Handle *cfg)
GNUNET_CONFIGURATION_get_value_number (cfg, "LOAD", "MAXIOLOAD",
&maxIOLoad))
return GNUNET_SYSERR;
GNUNET_CONFIGURATION_get_value_number (cfg, "LOAD", "MAXIOLOAD",
&maxIOLoad))
return GNUNET_SYSERR;
+ if (maxIOLoad == 0)
+ return 100;
return (100 * ret) / maxIOLoad;
}
return (100 * ret) / maxIOLoad;
}