summaryrefslogtreecommitdiff
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
parent89969d496f0acb304b4fd22867cb94b9ad93631e (diff)
fix watchdog for musl
-rw-r--r--package/watchdog/Makefile7
-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
7 files changed, 52 insertions, 25 deletions
diff --git a/package/watchdog/Makefile b/package/watchdog/Makefile
index a4c6d44a5..a8486dd6a 100644
--- a/package/watchdog/Makefile
+++ b/package/watchdog/Makefile
@@ -4,9 +4,9 @@
include ${TOPDIR}/rules.mk
PKG_NAME:= watchdog
-PKG_VERSION:= 5.7
-PKG_RELEASE:= 3
-PKG_MD5SUM:= 31766450ecfc9aff70fe966c0b9df06d
+PKG_VERSION:= 5.13
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 153455f008f1cf8f65f6ad9586a21ff1
PKG_DESCR:= watchdog daemon
PKG_SECTION:= utils
PKG_DEPENDS:= libtirpc
@@ -17,6 +17,7 @@ include ${TOPDIR}/mk/package.mk
$(eval $(call PKG_template,WATCHDOG,watchdog,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+TARGET_CPPFLAGS+= -D_GNU_SOURCE
TARGET_CFLAGS+= -I$(STAGING_TARGET_DIR)/usr/include/tirpc
TARGET_LDFLAGS+= -ltirpc
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;
- }
- }