summaryrefslogtreecommitdiff
path: root/package/watchdog/patches
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-03-22 21:01:52 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2014-03-22 21:01:52 +0100
commit125928117168dcead856747db13be6df2c0ba68a (patch)
tree7e411669fae9656bd9c5ec426668d6ee8a3d37c3 /package/watchdog/patches
parent89969d496f0acb304b4fd22867cb94b9ad93631e (diff)
fix watchdog for musl
Diffstat (limited to 'package/watchdog/patches')
-rw-r--r--package/watchdog/patches/patch-include_extern_h9
-rw-r--r--package/watchdog/patches/patch-src_memory_c11
-rw-r--r--package/watchdog/patches/patch-src_mntent_c11
-rw-r--r--package/watchdog/patches/patch-src_net_c10
-rw-r--r--package/watchdog/patches/patch-src_shutdown_c18
-rw-r--r--package/watchdog/patches/patch-src_umount_c11
6 files changed, 48 insertions, 22 deletions
diff --git a/package/watchdog/patches/patch-include_extern_h b/package/watchdog/patches/patch-include_extern_h
new file mode 100644
index 000000000..aea373525
--- /dev/null
+++ b/package/watchdog/patches/patch-include_extern_h
@@ -0,0 +1,9 @@
+--- watchdog-5.13.orig/include/extern.h 2013-02-01 12:15:44.000000000 +0100
++++ watchdog-5.13/include/extern.h 2014-03-22 15:41:57.000000000 +0100
+@@ -1,5 +1,6 @@
+ #include <netinet/in.h>
+ #include <stdio.h>
++#include <time.h>
+
+ /* external variables */
+ extern int softboot, watchdog, temp, maxtemp, tint, lastts, nrts;
diff --git a/package/watchdog/patches/patch-src_memory_c b/package/watchdog/patches/patch-src_memory_c
new file mode 100644
index 000000000..06540812e
--- /dev/null
+++ b/package/watchdog/patches/patch-src_memory_c
@@ -0,0 +1,11 @@
+--- watchdog-5.13.orig/src/memory.c 2013-02-01 12:15:44.000000000 +0100
++++ watchdog-5.13/src/memory.c 2014-03-22 16:07:15.000000000 +0100
+@@ -81,7 +81,7 @@ int check_memory(void)
+ syslog(LOG_INFO, "currently there are %d kB of free memory available", free);
+ #endif /* USE_SYSLOG */
+
+- if (free < minpages * (EXEC_PAGESIZE / 1024)) {
++ if (free < minpages * (4096 / 1024)) {
+ #if USE_SYSLOG
+ syslog(LOG_ERR, "memory %d kB is less than %d pages", free, minpages);
+ #endif /* USE_SYSLOG */
diff --git a/package/watchdog/patches/patch-src_mntent_c b/package/watchdog/patches/patch-src_mntent_c
deleted file mode 100644
index f2277bdbf..000000000
--- a/package/watchdog/patches/patch-src_mntent_c
+++ /dev/null
@@ -1,11 +0,0 @@
---- watchdog-5.7.orig/src/mntent.c 2010-01-06 13:42:08.000000000 +0100
-+++ watchdog-5.7/src/mntent.c 2010-02-06 04:39:34.804334839 +0100
-@@ -157,7 +157,7 @@ my_getmntent (mntFILE *mfp) {
- if (fgets (buf, sizeof(buf), mfp->mntent_fp) == NULL)
- return NULL;
-
-- s = index (buf, '\n');
-+ s = strchr (buf, '\n');
- if (s == NULL) {
- /* extremely long line - assume file was corrupted */
- mfp->mntent_errs = 1;
diff --git a/package/watchdog/patches/patch-src_net_c b/package/watchdog/patches/patch-src_net_c
new file mode 100644
index 000000000..da56cf791
--- /dev/null
+++ b/package/watchdog/patches/patch-src_net_c
@@ -0,0 +1,10 @@
+--- watchdog-5.13.orig/src/net.c 2013-02-01 12:15:44.000000000 +0100
++++ watchdog-5.13/src/net.c 2014-03-22 16:18:27.000000000 +0100
+@@ -6,6 +6,7 @@
+
+ #include <errno.h>
+ #include <sys/time.h>
++#include <sys/types.h>
+ #include <netinet/ip.h>
+ #include <netinet/ip_icmp.h>
+
diff --git a/package/watchdog/patches/patch-src_shutdown_c b/package/watchdog/patches/patch-src_shutdown_c
new file mode 100644
index 000000000..90ba0ee3c
--- /dev/null
+++ b/package/watchdog/patches/patch-src_shutdown_c
@@ -0,0 +1,18 @@
+--- watchdog-5.13.orig/src/shutdown.c 2013-02-01 12:15:44.000000000 +0100
++++ watchdog-5.13/src/shutdown.c 2014-03-22 16:29:44.000000000 +0100
+@@ -186,6 +186,7 @@ static void mnt_off()
+ FILE *fp;
+ struct mntent *mnt;
+
++#if defined __GLIBC__
+ fp = setmntent(MNTTAB, "r");
+ /* in some rare cases fp might be NULL so be careful */
+ while (fp != NULL && ((mnt = getmntent(fp)) != (struct mntent *) 0)) {
+@@ -241,6 +242,7 @@ static void mnt_off()
+ #endif
+ }
+ endmntent(fp);
++#endif
+ }
+
+ /* Parts of the following two functions are taken from Miquel van */
diff --git a/package/watchdog/patches/patch-src_umount_c b/package/watchdog/patches/patch-src_umount_c
deleted file mode 100644
index 6b5a82c1f..000000000
--- a/package/watchdog/patches/patch-src_umount_c
+++ /dev/null
@@ -1,11 +0,0 @@
---- watchdog-5.7.orig/src/umount.c 2010-01-06 13:42:08.000000000 +0100
-+++ watchdog-5.7/src/umount.c 2010-02-06 04:39:47.664334843 +0100
-@@ -212,7 +212,7 @@ umount_one (const char *spec, const char
- if (res < 0)
- umnt_err2 = errno;
- /* Do not complain about remote NFS mount points */
-- if (errno == ENOENT && index(spec, ':'))
-+ if (errno == ENOENT && strchr(spec, ':'))
- umnt_err2 = 0;
- }
- }