[packages] monit: update to 5.2.4

* add getloadavg patch
 * refresh patches
 * use build variants and PKG_INSTALL


git-svn-id: svn://svn.openwrt.org/openwrt/packages@25867 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
swalker
2011-03-04 18:19:54 +00:00
parent 8127c15f7a
commit a39dc985f1
3 changed files with 84 additions and 51 deletions

View File

@ -1,14 +1,18 @@
--- a/ssl.c
+++ b/ssl.c
@@ -673,9 +673,11 @@ ssl_connection *new_ssl_connection(char
ssl->method = SSLv23_client_method();
@@ -635,6 +635,7 @@ ssl_connection *new_ssl_connection(char
#endif
break;
+#ifndef OPENSSL_NO_SSLV2
case SSL_VERSION_SSLV2:
ssl->method = SSLv2_client_method();
#ifdef OPENSSL_FIPS
if (FIPS_mode()) {
@@ -647,6 +648,7 @@ ssl_connection *new_ssl_connection(char
}
#endif
break;
+#endif
case SSL_VERSION_SSLV3:
ssl->method = SSLv3_client_method();
#ifdef OPENSSL_FIPS

View File

@ -0,0 +1,48 @@
--- a/process/sysdep_LINUX.c
+++ b/process/sysdep_LINUX.c
@@ -144,6 +144,45 @@ static time_t get_starttime() {
return time(NULL) - (time_t)up;
}
+
+
+/* uclibc and dietlibc do not have this junk -ReneR */
+#if defined (__UCLIBC__) || defined (__dietlibc__)
+static int getloadavg (double loadavg[], int nelem)
+{
+ int fd;
+
+ fd = open ("/proc/loadavg", O_RDONLY);
+ if (fd < 0)
+ return -1;
+ else
+ {
+ char buf[65], *p;
+ ssize_t nread;
+ int i;
+
+ nread = read (fd, buf, sizeof buf - 1);
+ close (fd);
+ if (nread <= 0)
+ return -1;
+ buf[nread - 1] = '\0';
+
+ if (nelem > 3)
+ nelem = 3;
+ p = buf;
+ for (i = 0; i < nelem; ++i)
+ {
+ char *endp;
+ loadavg[i] = strtod (p, &endp);
+ if (endp == p)
+ return -1;
+ p = endp;
+ }
+
+ return i;
+ }
+}
+#endif
/* ------------------------------------------------------------------ Public */