watchdog/watchdog-5.9-cleanups.patch
Richard W.M. Jones ac9baefef0 - New upstream version 5.9 (RHBZ#645541).
- Package new wd_identify program.
- Drop old cleanup patch, most of it is now upstream.
- Add newer cleanup patch, sent upstream.
- Fix some problems with the initscript (RHBZ#523391).
- Add systemd service (file installed but not used) (RHBZ#661220).
2011-01-17 13:54:42 +00:00

71 lines
2.4 KiB
Diff

diff -ur watchdog-5.9.old/src/watchdog.c watchdog-5.9.cleanups/src/watchdog.c
--- watchdog-5.9.old/src/watchdog.c 2010-06-16 14:45:51.000000000 +0100
+++ watchdog-5.9.cleanups/src/watchdog.c 2011-01-17 13:53:22.268899519 +0000
@@ -638,7 +638,7 @@
* if the system runs out of memory */
filename_buf = (char*)malloc(max(strlen(logdir) + sizeof("/repair-bin.stdout") + 1, strlen("/proc//oom_adj") + sizeof(int) * CHAR_BIT * 10 / 3 + 1));
if (!filename_buf) {
- error(progname);
+ perror(progname);
exit(1);
}
@@ -713,7 +713,7 @@
for (act = iface; act != NULL; act = act->next)
syslog(LOG_INFO, "interface: %s", act->name);
- syslog(LOG_INFO, "test=%s(%ld) repair=%s(%d) alive=%s heartbeat=%s temp=%s to=%s no_act=%s",
+ syslog(LOG_INFO, "test=%s(%ld) repair=%s(%ld) alive=%s heartbeat=%s temp=%s to=%s no_act=%s",
(tbinary == NULL) ? "none" : tbinary, timeout,
(rbinary == NULL) ? "none" : rbinary, rtimeout,
(devname == NULL) ? "none" : devname,
@@ -947,4 +947,5 @@
terminate();
/* not reached */
+ exit (EXIT_SUCCESS);
}
diff -ur watchdog-5.9.old/src/wd_identify.c watchdog-5.9.cleanups/src/wd_identify.c
--- watchdog-5.9.old/src/wd_identify.c 2010-06-17 16:21:06.000000000 +0100
+++ watchdog-5.9.cleanups/src/wd_identify.c 2011-01-17 13:44:52.016374800 +0000
@@ -20,6 +20,8 @@
#include <stdlib.h>
#include <libgen.h>
#include <getopt.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
#define DEVICE "watchdog-device"
@@ -125,10 +127,7 @@
int main(int argc, char *const argv[])
{
- FILE *fp;
char *configfile = CONFIG_FILENAME;
- char *filename_buf;
- int count = 0;
int c;
struct watchdog_info ident;
char *opts = "c:";
diff -ur watchdog-5.9.old/src/wd_keepalive.c watchdog-5.9.cleanups/src/wd_keepalive.c
--- watchdog-5.9.old/src/wd_keepalive.c 2010-06-16 14:45:49.000000000 +0100
+++ watchdog-5.9.cleanups/src/wd_keepalive.c 2011-01-17 13:43:38.829707725 +0000
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
+#include <sys/ioctl.h>
#include <sys/wait.h>
#include <linux/watchdog.h>
#include <libgen.h>
@@ -286,7 +287,7 @@
* if the system runs out of memory */
filename_buf = (char*)malloc(strlen("/proc//oom_adj") + sizeof(int) * CHAR_BIT * 10 / 3 + 1);
if (!filename_buf) {
- error(progname);
+ perror(progname);
exit(1);
}