Updated the cleanup patch and sent upstream.
This commit is contained in:
parent
b853993b69
commit
088c532870
@ -1,6 +1,32 @@
|
|||||||
diff -ur watchdog-5.5/src/iface.c watchdog-5.5.cleanup/src/iface.c
|
Only in watchdog-5.5.cleanup: config.log
|
||||||
--- watchdog-5.5/src/iface.c 2009-02-25 11:12:59.000000000 +0000
|
Only in watchdog-5.5.cleanup: config.status
|
||||||
+++ watchdog-5.5.cleanup/src/iface.c 2009-02-26 15:28:24.000000000 +0000
|
Only in watchdog-5.5.cleanup/include: config.h
|
||||||
|
diff -ur watchdog-5.5.orig/include/extern.h watchdog-5.5.cleanup/include/extern.h
|
||||||
|
--- watchdog-5.5.orig/include/extern.h 2009-02-25 11:12:59.000000000 +0000
|
||||||
|
+++ watchdog-5.5.cleanup/include/extern.h 2009-03-13 10:34:52.000000000 +0000
|
||||||
|
@@ -48,8 +48,12 @@
|
||||||
|
#define MAXICMPLEN 76
|
||||||
|
#define MAXPACKET (65536 - 60 - 8) /* max packet size */
|
||||||
|
|
||||||
|
+#ifndef TRUE
|
||||||
|
#define TRUE 1
|
||||||
|
+#endif
|
||||||
|
+#ifndef FALSE
|
||||||
|
#define FALSE 0
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#define TS_SIZE 12
|
||||||
|
|
||||||
|
Only in watchdog-5.5.cleanup/include: extern.h~
|
||||||
|
Only in watchdog-5.5.cleanup/include: stamp-h1
|
||||||
|
Only in watchdog-5.5.cleanup: Makefile
|
||||||
|
Only in watchdog-5.5.cleanup/src: .deps
|
||||||
|
Only in watchdog-5.5.cleanup/src: file_stat.o
|
||||||
|
Only in watchdog-5.5.cleanup/src: file_table.o
|
||||||
|
Only in watchdog-5.5.cleanup/src: fstab.o
|
||||||
|
diff -ur watchdog-5.5.orig/src/iface.c watchdog-5.5.cleanup/src/iface.c
|
||||||
|
--- watchdog-5.5.orig/src/iface.c 2009-02-25 11:12:59.000000000 +0000
|
||||||
|
+++ watchdog-5.5.cleanup/src/iface.c 2009-03-13 10:21:43.000000000 +0000
|
||||||
@@ -66,7 +66,7 @@
|
@@ -66,7 +66,7 @@
|
||||||
#if USE_SYSLOG
|
#if USE_SYSLOG
|
||||||
/* do verbose logging */
|
/* do verbose logging */
|
||||||
@ -10,9 +36,12 @@ diff -ur watchdog-5.5/src/iface.c watchdog-5.5.cleanup/src/iface.c
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (dev->parameter.iface.bytes == bytes) {
|
if (dev->parameter.iface.bytes == bytes) {
|
||||||
diff -ur watchdog-5.5/src/keep_alive.c watchdog-5.5.cleanup/src/keep_alive.c
|
Only in watchdog-5.5.cleanup/src: iface.c~
|
||||||
--- watchdog-5.5/src/keep_alive.c 2009-02-25 11:12:59.000000000 +0000
|
Only in watchdog-5.5.cleanup/src: iface.o
|
||||||
+++ watchdog-5.5.cleanup/src/keep_alive.c 2009-02-26 15:28:24.000000000 +0000
|
Only in watchdog-5.5.cleanup/src: ifdown.o
|
||||||
|
diff -ur watchdog-5.5.orig/src/keep_alive.c watchdog-5.5.cleanup/src/keep_alive.c
|
||||||
|
--- watchdog-5.5.orig/src/keep_alive.c 2009-02-25 11:12:59.000000000 +0000
|
||||||
|
+++ watchdog-5.5.cleanup/src/keep_alive.c 2009-03-13 10:40:32.000000000 +0000
|
||||||
@@ -20,7 +20,6 @@
|
@@ -20,7 +20,6 @@
|
||||||
struct tm *tm;
|
struct tm *tm;
|
||||||
char tbuf[TS_SIZE + 1];
|
char tbuf[TS_SIZE + 1];
|
||||||
@ -21,44 +50,66 @@ diff -ur watchdog-5.5/src/keep_alive.c watchdog-5.5.cleanup/src/keep_alive.c
|
|||||||
|
|
||||||
if (hb == NULL)
|
if (hb == NULL)
|
||||||
return (ENOERR);
|
return (ENOERR);
|
||||||
diff -ur watchdog-5.5/src/lomount.c watchdog-5.5.cleanup/src/lomount.c
|
@@ -41,7 +40,8 @@
|
||||||
--- watchdog-5.5/src/lomount.c 2009-02-25 11:12:59.000000000 +0000
|
// success
|
||||||
+++ watchdog-5.5.cleanup/src/lomount.c 2009-02-26 15:28:24.000000000 +0000
|
if (nrts < hbstamps)
|
||||||
|
nrts++;
|
||||||
|
- lastts = ++lastts % hbstamps;
|
||||||
|
+ ++lastts;
|
||||||
|
+ lastts = lastts % hbstamps;
|
||||||
|
|
||||||
|
// write the buffer to the file
|
||||||
|
rewind(hb);
|
||||||
|
Only in watchdog-5.5.cleanup/src: keep_alive.c~
|
||||||
|
Only in watchdog-5.5.cleanup/src: keep_alive.o
|
||||||
|
Only in watchdog-5.5.cleanup/src: load.o
|
||||||
|
diff -ur watchdog-5.5.orig/src/lomount.c watchdog-5.5.cleanup/src/lomount.c
|
||||||
|
--- watchdog-5.5.orig/src/lomount.c 2009-02-25 11:12:59.000000000 +0000
|
||||||
|
+++ watchdog-5.5.cleanup/src/lomount.c 2009-03-13 10:24:55.000000000 +0000
|
||||||
@@ -195,13 +195,13 @@
|
@@ -195,13 +195,13 @@
|
||||||
break;
|
break;
|
||||||
case LO_CRYPT_XOR:
|
case LO_CRYPT_XOR:
|
||||||
pass = getpass ("Password: ");
|
pass = getpass ("Password: ");
|
||||||
- strncpy (loopinfo.lo_encrypt_key, pass, LO_KEY_SIZE);
|
- strncpy (loopinfo.lo_encrypt_key, pass, LO_KEY_SIZE);
|
||||||
+ strncpy ((char *)loopinfo.lo_encrypt_key, pass, LO_KEY_SIZE);
|
+ strncpy ((char *) loopinfo.lo_encrypt_key, pass, LO_KEY_SIZE);
|
||||||
loopinfo.lo_encrypt_key[LO_KEY_SIZE - 1] = 0;
|
loopinfo.lo_encrypt_key[LO_KEY_SIZE - 1] = 0;
|
||||||
- loopinfo.lo_encrypt_key_size = strlen (loopinfo.lo_encrypt_key);
|
- loopinfo.lo_encrypt_key_size = strlen (loopinfo.lo_encrypt_key);
|
||||||
+ loopinfo.lo_encrypt_key_size = (int) strlen ((char *)loopinfo.lo_encrypt_key);
|
+ loopinfo.lo_encrypt_key_size = (int) strlen ((char *) loopinfo.lo_encrypt_key);
|
||||||
break;
|
break;
|
||||||
case LO_CRYPT_DES:
|
case LO_CRYPT_DES:
|
||||||
pass = getpass ("Password: ");
|
pass = getpass ("Password: ");
|
||||||
- strncpy (loopinfo.lo_encrypt_key, pass, 8);
|
- strncpy (loopinfo.lo_encrypt_key, pass, 8);
|
||||||
+ strncpy ((char *)loopinfo.lo_encrypt_key, pass, 8);
|
+ strncpy ((char *) loopinfo.lo_encrypt_key, pass, 8);
|
||||||
loopinfo.lo_encrypt_key[8] = 0;
|
loopinfo.lo_encrypt_key[8] = 0;
|
||||||
loopinfo.lo_encrypt_key_size = 8;
|
loopinfo.lo_encrypt_key_size = 8;
|
||||||
pass = getpass ("Init (up to 16 hex digits): ");
|
pass = getpass ("Init (up to 16 hex digits): ");
|
||||||
diff -ur watchdog-5.5/src/mntent.c watchdog-5.5.cleanup/src/mntent.c
|
Only in watchdog-5.5.cleanup/src: lomount.c~
|
||||||
--- watchdog-5.5/src/mntent.c 2009-02-25 11:12:59.000000000 +0000
|
Only in watchdog-5.5.cleanup/src: lomount.o
|
||||||
+++ watchdog-5.5.cleanup/src/mntent.c 2009-02-26 15:28:24.000000000 +0000
|
Only in watchdog-5.5.cleanup/src: Makefile
|
||||||
@@ -21,9 +21,9 @@
|
Only in watchdog-5.5.cleanup/src: memory.o
|
||||||
|
diff -ur watchdog-5.5.orig/src/mntent.c watchdog-5.5.cleanup/src/mntent.c
|
||||||
|
--- watchdog-5.5.orig/src/mntent.c 2009-02-25 11:12:59.000000000 +0000
|
||||||
|
+++ watchdog-5.5.cleanup/src/mntent.c 2009-03-13 10:25:47.000000000 +0000
|
||||||
|
@@ -21,11 +21,11 @@
|
||||||
static char need_escaping[] = { ' ', '\t', '\n', '\\' };
|
static char need_escaping[] = { ' ', '\t', '\n', '\\' };
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
-mangle(unsigned char *s) {
|
-mangle(unsigned char *s) {
|
||||||
+mangle(const char *s) {
|
+mangle(const char *s) {
|
||||||
char *ss, *sp;
|
char *ss, *sp;
|
||||||
- int n;
|
int n;
|
||||||
+ size_t n;
|
|
||||||
|
|
||||||
n = strlen(s);
|
- n = strlen(s);
|
||||||
|
+ n = (int) strlen(s);
|
||||||
ss = sp = xmalloc(4*n+1);
|
ss = sp = xmalloc(4*n+1);
|
||||||
diff -ur watchdog-5.5/src/net.c watchdog-5.5.cleanup/src/net.c
|
while(1) {
|
||||||
--- watchdog-5.5/src/net.c 2009-02-25 11:12:59.000000000 +0000
|
for (n = 0; n < sizeof(need_escaping); n++) {
|
||||||
+++ watchdog-5.5.cleanup/src/net.c 2009-02-26 15:28:24.000000000 +0000
|
Only in watchdog-5.5.cleanup/src: mntent.c~
|
||||||
|
Only in watchdog-5.5.cleanup/src: mntent.o
|
||||||
|
Only in watchdog-5.5.cleanup/src: mount.o
|
||||||
|
diff -ur watchdog-5.5.orig/src/net.c watchdog-5.5.cleanup/src/net.c
|
||||||
|
--- watchdog-5.5.orig/src/net.c 2009-02-25 11:12:59.000000000 +0000
|
||||||
|
+++ watchdog-5.5.cleanup/src/net.c 2009-03-13 10:28:09.000000000 +0000
|
||||||
@@ -57,7 +57,9 @@
|
@@ -57,7 +57,9 @@
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
|
|
||||||
@ -70,7 +121,7 @@ diff -ur watchdog-5.5/src/net.c watchdog-5.5.cleanup/src/net.c
|
|||||||
struct timeval timeout, dtimeout;
|
struct timeval timeout, dtimeout;
|
||||||
struct icmphdr *icp = (struct icmphdr *) outpack;
|
struct icmphdr *icp = (struct icmphdr *) outpack;
|
||||||
|
|
||||||
@@ -119,11 +121,11 @@
|
@@ -119,10 +121,11 @@
|
||||||
break;
|
break;
|
||||||
#if USE_SYSLOG
|
#if USE_SYSLOG
|
||||||
if (verbose && logtick && ticker == 1)
|
if (verbose && logtick && ticker == 1)
|
||||||
@ -80,25 +131,29 @@ diff -ur watchdog-5.5/src/net.c watchdog-5.5.cleanup/src/net.c
|
|||||||
+ fdmask_p = &fdmask;
|
+ fdmask_p = &fdmask;
|
||||||
|
|
||||||
- if (select(sock_fp + 1, (fd_set *) & fdmask, (fd_set *) NULL,
|
- if (select(sock_fp + 1, (fd_set *) & fdmask, (fd_set *) NULL,
|
||||||
- (fd_set *) NULL, &dtimeout) >= 1) {
|
+ if (select(sock_fp + 1, (fd_set *) fdmask_p, (fd_set *) NULL,
|
||||||
+ if (select(sock_fp + 1, (fd_set *) fdmask_p, (fd_set *) NULL, (fd_set *) NULL, &dtimeout) >= 1) {
|
(fd_set *) NULL, &dtimeout) >= 1) {
|
||||||
|
|
||||||
/* read reply */
|
/* read reply */
|
||||||
fromlen = sizeof(from);
|
Only in watchdog-5.5.cleanup/src: net.c~
|
||||||
diff -ur watchdog-5.5/src/nfsmount.c watchdog-5.5.cleanup/src/nfsmount.c
|
Only in watchdog-5.5.cleanup/src: net.o
|
||||||
--- watchdog-5.5/src/nfsmount.c 2009-02-25 11:12:59.000000000 +0000
|
diff -ur watchdog-5.5.orig/src/nfsmount.c watchdog-5.5.cleanup/src/nfsmount.c
|
||||||
+++ watchdog-5.5.cleanup/src/nfsmount.c 2009-02-26 15:28:24.000000000 +0000
|
--- watchdog-5.5.orig/src/nfsmount.c 2009-02-25 11:12:59.000000000 +0000
|
||||||
@@ -55,6 +55,7 @@
|
+++ watchdog-5.5.cleanup/src/nfsmount.c 2009-03-13 10:28:33.000000000 +0000
|
||||||
#include <linux/nfs.h>
|
@@ -48,6 +48,7 @@
|
||||||
#include "mount_constants.h"
|
#include <sys/stat.h>
|
||||||
#include "nfs_mount4.h"
|
#include <netinet/in.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
+#include <time.h>
|
+#include <time.h>
|
||||||
|
|
||||||
#define HAVE_inet_aton
|
#include "sundries.h"
|
||||||
|
#include "nfsmount.h"
|
||||||
diff -ur watchdog-5.5/src/nfsmount_xdr.c watchdog-5.5.cleanup/src/nfsmount_xdr.c
|
Only in watchdog-5.5.cleanup/src: nfsmount.c~
|
||||||
--- watchdog-5.5/src/nfsmount_xdr.c 2009-02-25 11:12:59.000000000 +0000
|
Only in watchdog-5.5.cleanup/src: nfsmount_clnt.o
|
||||||
+++ watchdog-5.5.cleanup/src/nfsmount_xdr.c 2009-02-26 15:28:24.000000000 +0000
|
Only in watchdog-5.5.cleanup/src: nfsmount.o
|
||||||
|
diff -ur watchdog-5.5.orig/src/nfsmount_xdr.c watchdog-5.5.cleanup/src/nfsmount_xdr.c
|
||||||
|
--- watchdog-5.5.orig/src/nfsmount_xdr.c 2009-02-25 11:12:59.000000000 +0000
|
||||||
|
+++ watchdog-5.5.cleanup/src/nfsmount_xdr.c 2009-03-13 10:29:31.000000000 +0000
|
||||||
@@ -43,8 +43,6 @@
|
@@ -43,8 +43,6 @@
|
||||||
bool_t
|
bool_t
|
||||||
xdr_fhandle (XDR *xdrs, fhandle objp)
|
xdr_fhandle (XDR *xdrs, fhandle objp)
|
||||||
@ -225,54 +280,49 @@ diff -ur watchdog-5.5/src/nfsmount_xdr.c watchdog-5.5.cleanup/src/nfsmount_xdr.c
|
|||||||
if (!xdr_dirpath (xdrs, &objp->ex_dir))
|
if (!xdr_dirpath (xdrs, &objp->ex_dir))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (!xdr_groups (xdrs, &objp->ex_groups))
|
if (!xdr_groups (xdrs, &objp->ex_groups))
|
||||||
@@ -212,8 +184,7 @@
|
Only in watchdog-5.5.cleanup/src: nfsmount_xdr.c~
|
||||||
bool_t
|
Only in watchdog-5.5.cleanup/src: nfsmount_xdr.o
|
||||||
xdr_ppathcnf (XDR *xdrs, ppathcnf *objp)
|
diff -ur watchdog-5.5.orig/src/pidfile.c watchdog-5.5.cleanup/src/pidfile.c
|
||||||
{
|
--- watchdog-5.5.orig/src/pidfile.c 2009-02-25 11:12:59.000000000 +0000
|
||||||
- register int32_t *buf;
|
+++ watchdog-5.5.cleanup/src/pidfile.c 2009-03-13 10:30:08.000000000 +0000
|
||||||
-
|
@@ -6,6 +6,10 @@
|
||||||
+ register int32_t *buf;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (xdrs->x_op == XDR_ENCODE) {
|
#include <errno.h>
|
||||||
diff -ur watchdog-5.5/src/pidfile.c watchdog-5.5.cleanup/src/pidfile.c
|
|
||||||
--- watchdog-5.5/src/pidfile.c 2009-02-25 11:12:59.000000000 +0000
|
|
||||||
+++ watchdog-5.5.cleanup/src/pidfile.c 2009-02-26 15:28:24.000000000 +0000
|
|
||||||
@@ -8,7 +8,9 @@
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include "extern.h"
|
|
||||||
#include "watch_err.h"
|
|
||||||
-
|
|
||||||
+#include <unistd.h>
|
+#include <unistd.h>
|
||||||
+#include <stdlib.h>
|
+#include <stdlib.h>
|
||||||
+#include <wait.h>
|
+#include <wait.h>
|
||||||
#if USE_SYSLOG
|
+
|
||||||
#include <syslog.h>
|
|
||||||
#endif
|
|
||||||
diff -ur watchdog-5.5/src/shutdown.c watchdog-5.5.cleanup/src/shutdown.c
|
|
||||||
--- watchdog-5.5/src/shutdown.c 2009-02-25 11:12:59.000000000 +0000
|
|
||||||
+++ watchdog-5.5.cleanup/src/shutdown.c 2009-02-26 15:28:24.000000000 +0000
|
|
||||||
@@ -22,6 +22,10 @@
|
|
||||||
#include "watch_err.h"
|
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
|
#include "watch_err.h"
|
||||||
|
|
||||||
|
Only in watchdog-5.5.cleanup/src: pidfile.c~
|
||||||
|
Only in watchdog-5.5.cleanup/src: pidfile.o
|
||||||
|
diff -ur watchdog-5.5.orig/src/shutdown.c watchdog-5.5.cleanup/src/shutdown.c
|
||||||
|
--- watchdog-5.5.orig/src/shutdown.c 2009-02-25 11:12:59.000000000 +0000
|
||||||
|
+++ watchdog-5.5.cleanup/src/shutdown.c 2009-03-13 10:35:53.000000000 +0000
|
||||||
|
@@ -4,6 +4,9 @@
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#define _XOPEN_SOURCE 500 /* for getsid(2) */
|
||||||
|
+#define _BSD_SOURCE /* for acct(2) */
|
||||||
|
+
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
@@ -18,6 +21,10 @@
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
+#include <sys/types.h>
|
+#include <sys/types.h>
|
||||||
+#include <unistd.h>
|
+#include <unistd.h>
|
||||||
+#include <time.h>
|
+#include <time.h>
|
||||||
+
|
+#include <rpc/types.h> /* for caddr_t */
|
||||||
#if defined __GLIBC__
|
|
||||||
#include "ext2_mnt.h"
|
|
||||||
#include <sys/quota.h>
|
|
||||||
@@ -66,7 +70,7 @@
|
|
||||||
{
|
|
||||||
#if USE_SYSLOG
|
|
||||||
/* Log the closing message */
|
|
||||||
- syslog(LOG_INFO, "stopping daemon (%d.%d)", MAJOR_VERSION, MINOR_VERSION);
|
|
||||||
+ syslog(LOG_INFO, "stopping daemon (%d.%.1f)", MAJOR_VERSION, MINOR_VERSION);
|
|
||||||
closelog();
|
|
||||||
|
|
||||||
sleep(5); /* make sure log is written */
|
#include "watch_err.h"
|
||||||
@@ -320,6 +324,7 @@
|
#include "extern.h"
|
||||||
|
@@ -320,6 +327,7 @@
|
||||||
void do_shutdown(int errorcode)
|
void do_shutdown(int errorcode)
|
||||||
{
|
{
|
||||||
int i = 0, fd;
|
int i = 0, fd;
|
||||||
@ -280,7 +330,16 @@ diff -ur watchdog-5.5/src/shutdown.c watchdog-5.5.cleanup/src/shutdown.c
|
|||||||
char *seedbck = RANDOM_SEED;
|
char *seedbck = RANDOM_SEED;
|
||||||
|
|
||||||
/* soft-boot the system */
|
/* soft-boot the system */
|
||||||
@@ -438,7 +443,7 @@
|
@@ -338,7 +346,7 @@
|
||||||
|
* We cannot let the shell check, because a non-existant or
|
||||||
|
* non-executable sendmail binary means that the pipe is closed faster
|
||||||
|
* than we can write to it. */
|
||||||
|
- if ((stat(PATH_SENDMAIL, &buf) != 0) || (buf.st_mode&S_IXUSR == 0))
|
||||||
|
+ if ((stat(PATH_SENDMAIL, &buf) != 0) || ((buf.st_mode&S_IXUSR) == 0))
|
||||||
|
#if USE_SYSLOG
|
||||||
|
syslog(LOG_ERR, "%s does not exist or is not executable (errno = %d)", PATH_SENDMAIL, errno);
|
||||||
|
#endif /* USE_SYSLOG */
|
||||||
|
@@ -438,7 +446,7 @@
|
||||||
wtmp.ut_pid = 0;
|
wtmp.ut_pid = 0;
|
||||||
wtmp.ut_type = RUN_LVL;
|
wtmp.ut_type = RUN_LVL;
|
||||||
wtmp.ut_time = t;
|
wtmp.ut_time = t;
|
||||||
@ -289,21 +348,21 @@ diff -ur watchdog-5.5/src/shutdown.c watchdog-5.5.cleanup/src/shutdown.c
|
|||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,8 +458,9 @@
|
@@ -454,7 +462,7 @@
|
||||||
if ((fd_bck = creat(seedbck, S_IRUSR | S_IWUSR)) >= 0) {
|
|
||||||
char buf[512];
|
char buf[512];
|
||||||
|
|
||||||
- if (read(fd_seed, buf, 512) == 512)
|
if (read(fd_seed, buf, 512) == 512)
|
||||||
- write(fd_bck, buf, 512);
|
- write(fd_bck, buf, 512);
|
||||||
+ if (read(fd_seed, buf, 512) == 512) {
|
+ write_len = write(fd_bck, buf, 512);
|
||||||
+ write_len= write(fd_bck, buf, 512);
|
|
||||||
+ }
|
|
||||||
close(fd_bck);
|
close(fd_bck);
|
||||||
}
|
}
|
||||||
close(fd_seed);
|
close(fd_seed);
|
||||||
diff -ur watchdog-5.5/src/temp.c watchdog-5.5.cleanup/src/temp.c
|
Only in watchdog-5.5.cleanup/src: shutdown.c~
|
||||||
--- watchdog-5.5/src/temp.c 2009-02-25 11:12:59.000000000 +0000
|
Only in watchdog-5.5.cleanup/src: shutdown.o
|
||||||
+++ watchdog-5.5.cleanup/src/temp.c 2009-02-26 15:28:24.000000000 +0000
|
Only in watchdog-5.5.cleanup/src: sundries.o
|
||||||
|
diff -ur watchdog-5.5.orig/src/temp.c watchdog-5.5.cleanup/src/temp.c
|
||||||
|
--- watchdog-5.5.orig/src/temp.c 2009-02-25 11:12:59.000000000 +0000
|
||||||
|
+++ watchdog-5.5.cleanup/src/temp.c 2009-03-13 10:36:04.000000000 +0000
|
||||||
@@ -31,7 +31,7 @@
|
@@ -31,7 +31,7 @@
|
||||||
int err = errno;
|
int err = errno;
|
||||||
|
|
||||||
@ -313,18 +372,21 @@ diff -ur watchdog-5.5/src/temp.c watchdog-5.5.cleanup/src/temp.c
|
|||||||
#else /* USE_SYSLOG */
|
#else /* USE_SYSLOG */
|
||||||
perror(progname);
|
perror(progname);
|
||||||
#endif /* USE_SYSLOG */
|
#endif /* USE_SYSLOG */
|
||||||
diff -ur watchdog-5.5/src/test_binary.c watchdog-5.5.cleanup/src/test_binary.c
|
Only in watchdog-5.5.cleanup/src: temp.c~
|
||||||
--- watchdog-5.5/src/test_binary.c 2009-02-25 11:12:59.000000000 +0000
|
Only in watchdog-5.5.cleanup/src: temp.o
|
||||||
+++ watchdog-5.5.cleanup/src/test_binary.c 2009-02-26 15:28:24.000000000 +0000
|
diff -ur watchdog-5.5.orig/src/test_binary.c watchdog-5.5.cleanup/src/test_binary.c
|
||||||
@@ -10,6 +10,7 @@
|
--- watchdog-5.5.orig/src/test_binary.c 2009-02-25 11:12:59.000000000 +0000
|
||||||
|
+++ watchdog-5.5.cleanup/src/test_binary.c 2009-03-13 10:36:58.000000000 +0000
|
||||||
|
@@ -8,6 +8,8 @@
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
+#include <time.h>
|
||||||
|
+
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
#include "watch_err.h"
|
#include "watch_err.h"
|
||||||
+#include <time.h>
|
|
||||||
|
|
||||||
#if USE_SYSLOG
|
@@ -76,7 +78,7 @@
|
||||||
#include <syslog.h>
|
|
||||||
@@ -76,7 +77,7 @@
|
|
||||||
res = check_processes(timeout);
|
res = check_processes(timeout);
|
||||||
if (res == ETOOLONG) {
|
if (res == ETOOLONG) {
|
||||||
#if USE_SYSLOG
|
#if USE_SYSLOG
|
||||||
@ -333,50 +395,33 @@ diff -ur watchdog-5.5/src/test_binary.c watchdog-5.5.cleanup/src/test_binary.c
|
|||||||
#endif /* USE_SYSLOG */
|
#endif /* USE_SYSLOG */
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
diff -ur watchdog-5.5/src/watchdog.c watchdog-5.5.cleanup/src/watchdog.c
|
Only in watchdog-5.5.cleanup/src: test_binary.c~
|
||||||
--- watchdog-5.5/src/watchdog.c 2009-02-25 11:12:59.000000000 +0000
|
Only in watchdog-5.5.cleanup/src: test_binary.o
|
||||||
+++ watchdog-5.5.cleanup/src/watchdog.c 2009-02-26 15:28:24.000000000 +0000
|
Only in watchdog-5.5.cleanup/src: umount.o
|
||||||
@@ -23,6 +23,10 @@
|
Only in watchdog-5.5.cleanup/src: version.o
|
||||||
|
Only in watchdog-5.5.cleanup/src: watchdog
|
||||||
|
diff -ur watchdog-5.5.orig/src/watchdog.c watchdog-5.5.cleanup/src/watchdog.c
|
||||||
|
--- watchdog-5.5.orig/src/watchdog.c 2009-02-25 11:12:59.000000000 +0000
|
||||||
|
+++ watchdog-5.5.cleanup/src/watchdog.c 2009-03-13 10:42:44.000000000 +0000
|
||||||
|
@@ -23,6 +23,8 @@
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
+#include <sys/stat.h>
|
+#include <sys/stat.h>
|
||||||
+#include <sys/types.h>
|
+#include <sys/types.h>
|
||||||
+
|
|
||||||
+
|
|
||||||
#define __USE_GNU
|
#define __USE_GNU
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -72,7 +76,7 @@
|
@@ -619,7 +621,7 @@
|
||||||
int softboot = FALSE, watchdog = -1, load = -1, mem = -1, temp = -1;
|
|
||||||
int tint = 10, logtick = 1, ticker = 1, schedprio = 1;
|
|
||||||
int maxload1 = 0, maxload5 = 0, maxload15 = 0, minpages = 0;
|
|
||||||
-int maxtemp = 120, hbstamps = 300, lastts, nrts;
|
|
||||||
+int maxtemp = 120, hbstamps = 300, lastts=0, nrts;
|
|
||||||
int pingcount = 3;
|
|
||||||
char *tempname = NULL, *devname = NULL, *admin = "root", *progname;
|
|
||||||
char *timestamps, *heartbeat;
|
|
||||||
@@ -85,7 +89,7 @@
|
|
||||||
|
|
||||||
static void usage(void)
|
|
||||||
{
|
|
||||||
- fprintf(stderr, "%s version %d.%d, usage:\n", progname, MAJOR_VERSION, MINOR_VERSION);
|
|
||||||
+ fprintf(stderr, "%s version %d.%.1f, usage:\n", progname, MAJOR_VERSION, MINOR_VERSION);
|
|
||||||
#if USE_SYSLOG
|
|
||||||
fprintf(stderr, "%s [-i <interval> [-f]] [-l <max load avg>] [-v] [-s] [-b] [-m <max temperature>]\n", progname);
|
|
||||||
#else /* USE_SYSLOG */
|
|
||||||
@@ -618,8 +622,8 @@
|
|
||||||
|
|
||||||
/* Log the starting message */
|
/* Log the starting message */
|
||||||
openlog(progname, LOG_PID, LOG_DAEMON);
|
openlog(progname, LOG_PID, LOG_DAEMON);
|
||||||
- syslog(LOG_INFO, "starting daemon (%d.%d):", MAJOR_VERSION, MINOR_VERSION);
|
syslog(LOG_INFO, "starting daemon (%d.%d):", MAJOR_VERSION, MINOR_VERSION);
|
||||||
- syslog(LOG_INFO, "int=%ds realtime=%s sync=%s soft=%s mla=%d mem=%ld",
|
- syslog(LOG_INFO, "int=%ds realtime=%s sync=%s soft=%s mla=%d mem=%ld",
|
||||||
+ syslog(LOG_INFO, "starting daemon (%d.%.1f):", MAJOR_VERSION, MINOR_VERSION);
|
|
||||||
+ syslog(LOG_INFO, "int=%ds realtime=%s sync=%s soft=%s mla=%d mem=%d",
|
+ syslog(LOG_INFO, "int=%ds realtime=%s sync=%s soft=%s mla=%d mem=%d",
|
||||||
tint,
|
tint,
|
||||||
realtime ? "yes" : "no",
|
realtime ? "yes" : "no",
|
||||||
sync_it ? "yes" : "no",
|
sync_it ? "yes" : "no",
|
||||||
@@ -650,7 +654,7 @@
|
@@ -650,7 +652,7 @@
|
||||||
for (act = iface; act != NULL; act = act->next)
|
for (act = iface; act != NULL; act = act->next)
|
||||||
syslog(LOG_INFO, "interface: %s", act->name);
|
syslog(LOG_INFO, "interface: %s", act->name);
|
||||||
|
|
||||||
@ -385,7 +430,7 @@ diff -ur watchdog-5.5/src/watchdog.c watchdog-5.5.cleanup/src/watchdog.c
|
|||||||
(tbinary == NULL) ? "none" : tbinary, timeout,
|
(tbinary == NULL) ? "none" : tbinary, timeout,
|
||||||
(rbinary == NULL) ? "none" : rbinary,
|
(rbinary == NULL) ? "none" : rbinary,
|
||||||
(devname == NULL) ? "none" : devname,
|
(devname == NULL) ? "none" : devname,
|
||||||
@@ -692,7 +696,7 @@
|
@@ -692,7 +694,7 @@
|
||||||
/* Allocate memory for keeping the timestamps in */
|
/* Allocate memory for keeping the timestamps in */
|
||||||
nrts = 0;
|
nrts = 0;
|
||||||
lastts = 0;
|
lastts = 0;
|
||||||
@ -394,23 +439,27 @@ diff -ur watchdog-5.5/src/watchdog.c watchdog-5.5.cleanup/src/watchdog.c
|
|||||||
if ( timestamps == NULL ) {
|
if ( timestamps == NULL ) {
|
||||||
#if USE_SYSLOG
|
#if USE_SYSLOG
|
||||||
syslog(LOG_ERR, "cannot allocate memory for timestamps (errno = %d = '%m')", errno);
|
syslog(LOG_ERR, "cannot allocate memory for timestamps (errno = %d = '%m')", errno);
|
||||||
diff -ur watchdog-5.5/src/wd_keepalive.c watchdog-5.5.cleanup/src/wd_keepalive.c
|
@@ -707,7 +709,8 @@
|
||||||
--- watchdog-5.5/src/wd_keepalive.c 2009-02-25 11:12:59.000000000 +0000
|
memcpy(timestamps + (TS_SIZE * lastts), rbuf, TS_SIZE);
|
||||||
+++ watchdog-5.5.cleanup/src/wd_keepalive.c 2009-02-26 15:29:18.000000000 +0000
|
if (nrts < hbstamps)
|
||||||
@@ -24,6 +24,7 @@
|
nrts++;
|
||||||
#include <stdlib.h>
|
- lastts = ++lastts % hbstamps;
|
||||||
#include <sys/mman.h>
|
+ ++lastts;
|
||||||
#include <sys/wait.h>
|
+ lastts = lastts % hbstamps;
|
||||||
+
|
}
|
||||||
#define __USE_GNU
|
/* Write an indication that the watchdog has started to the heartbeat file */
|
||||||
#include <string.h>
|
/* copy it to the buffer */
|
||||||
#include <syslog.h>
|
@@ -717,7 +720,8 @@
|
||||||
@@ -271,7 +272,7 @@
|
// success
|
||||||
|
if (nrts < hbstamps)
|
||||||
|
nrts++;
|
||||||
|
- lastts = ++lastts % hbstamps;
|
||||||
|
+ ++lastts;
|
||||||
|
+ lastts = lastts % hbstamps;
|
||||||
|
|
||||||
/* Log the starting message */
|
}
|
||||||
openlog(progname, LOG_PID, LOG_DAEMON);
|
}
|
||||||
- sprintf(log, "starting watchdog keepalive daemon (%d.%d):", MAJOR_VERSION, MINOR_VERSION);
|
Only in watchdog-5.5.cleanup/src: watchdog.c~
|
||||||
+ sprintf(log, "starting watchdog keepalive daemon (%d.%.1f):", MAJOR_VERSION, MINOR_VERSION);
|
Only in watchdog-5.5.cleanup/src: watchdog.o
|
||||||
sprintf(log + strlen(log), " int=%d alive=%s realtime=%s", tint, devname, realtime ? "yes" : "no");
|
Only in watchdog-5.5.cleanup/src: wd_keepalive
|
||||||
syslog(LOG_INFO, log);
|
Only in watchdog-5.5.cleanup/src: wd_keepalive.o
|
||||||
#endif /* USE_SYSLOG */
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Summary: Software and/or Hardware watchdog daemon
|
Summary: Software and/or Hardware watchdog daemon
|
||||||
Name: watchdog
|
Name: watchdog
|
||||||
Version: 5.5
|
Version: 5.5
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
License: GPL+
|
License: GPL+
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
|
|
||||||
@ -99,6 +99,9 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Mar 13 2009 Richard W.M. Jones <rjones@redhat.com> - 5.5-4
|
||||||
|
- Updated the cleanup patch and sent upstream.
|
||||||
|
|
||||||
* Fri Mar 13 2009 Richard W.M. Jones <rjones@redhat.com> - 5.5-3
|
* Fri Mar 13 2009 Richard W.M. Jones <rjones@redhat.com> - 5.5-3
|
||||||
- Remove dubious "cleanup-nfs" patch.
|
- Remove dubious "cleanup-nfs" patch.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user