diff --git a/sanlock-fix-libwdmd-linking.patch b/sanlock-fix-libwdmd-linking.patch new file mode 100644 index 0000000..7b6f945 --- /dev/null +++ b/sanlock-fix-libwdmd-linking.patch @@ -0,0 +1,36 @@ +From eabcca788b5cf8b126bd7ba24991c37f952b9a02 Mon Sep 17 00:00:00 2001 +From: David Teigland +Date: Thu, 9 Jun 2011 17:22:38 -0500 +Subject: [PATCH] sanlock: fix libwdmd linking + +--- + src/Makefile | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index 93d0306..9491ce1 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -61,8 +61,8 @@ CFLAGS += -D_GNU_SOURCE -g \ + -fasynchronous-unwind-tables \ + -fdiagnostics-show-option + +-CMD_LDFLAGS = -lpthread -lrt -laio -lblkid -lsanlock -lwdmd +-LIB_LDFLAGS = -lpthread -lrt -laio -lblkid -lwdmd ++CMD_LDFLAGS = -lpthread -lrt -laio -lblkid -lsanlock -L../wdmd -lwdmd ++LIB_LDFLAGS = -lpthread -lrt -laio -lblkid -L../wdmd -lwdmd + + + all: $(SHLIB_TARGET) $(CMD_TARGET) +@@ -73,7 +73,7 @@ $(SHLIB_TARGET): $(LIB_SOURCE) + ln -sf $(SHLIB_TARGET) $(LIB_TARGET).so.$(SOMAJOR) + + $(CMD_TARGET): $(SHLIB_TARGET) $(CMD_SOURCE) +- $(CC) $(CFLAGS) $(CMD_LDFLAGS) $(CMD_SOURCE) -o $@ -L. -L../wdmd ++ $(CC) $(CFLAGS) $(CMD_LDFLAGS) $(CMD_SOURCE) -o $@ -L. + + clean: + rm -f *.o *.so *.so.* $(CMD_TARGET) +-- +1.7.1.1 + diff --git a/sanlock-wdmd-shut-up-warnings.patch b/sanlock-wdmd-shut-up-warnings.patch new file mode 100644 index 0000000..2a688fb --- /dev/null +++ b/sanlock-wdmd-shut-up-warnings.patch @@ -0,0 +1,67 @@ +From 5772bd9c4f6b38132ed834bf4e48f899946ff923 Mon Sep 17 00:00:00 2001 +From: David Teigland +Date: Thu, 9 Jun 2011 16:54:09 -0500 +Subject: [PATCH] sanlock/wdmd: shut up warnings + +--- + src/paxos_lease.c | 4 ++-- + wdmd/main.c | 13 +++++++++---- + 2 files changed, 11 insertions(+), 6 deletions(-) + +diff --git a/src/paxos_lease.c b/src/paxos_lease.c +index 141c61d..e842b93 100644 +--- a/src/paxos_lease.c ++++ b/src/paxos_lease.c +@@ -724,7 +724,7 @@ static int _leader_read_multiple(struct task *task, + int leaders_len, leader_reps_len; + int num_reads; + int num_disks = token->r.num_disks; +- int rv, d, i, found; ++ int rv = 0, d, i, found; + int error; + + leaders_len = num_disks * sizeof(struct leader_record); +@@ -978,7 +978,7 @@ static int write_new_leader(struct task *task, + int num_disks = token->r.num_disks; + int num_writes = 0; + int error = SANLK_OK; +- int rv, d; ++ int rv = 0, d; + + for (d = 0; d < num_disks; d++) { + rv = write_leader(task, &token->disks[d], nl); +diff --git a/wdmd/main.c b/wdmd/main.c +index a020b1e..e024c82 100644 +--- a/wdmd/main.c ++++ b/wdmd/main.c +@@ -330,7 +330,7 @@ static int setup_listener_socket(int *listener_socket) + + static int setup_clients(void) + { +- int rv, fd, ci; ++ int rv, fd = -1, ci; + + rv = setup_listener_socket(&fd); + if (rv < 0) +@@ -610,10 +610,15 @@ static int test_scripts(void) { return 0; } + + static void close_watchdog(void) + { +- write(dev_fd, "V", 1); +- close(dev_fd); ++ int rv; ++ ++ rv = write(dev_fd, "V", 1); ++ if (rv < 0) ++ log_error("/dev/watchdog disarm write error %d", errno); ++ else ++ log_error("/dev/watchdog disarmed"); + +- log_error("/dev/watchdog disarmed"); ++ close(dev_fd); + } + + static int setup_watchdog(void) +-- +1.7.1.1 + diff --git a/sanlock.spec b/sanlock.spec index 98893c1..6f4f747 100644 --- a/sanlock.spec +++ b/sanlock.spec @@ -1,6 +1,6 @@ Name: sanlock Version: 1.3 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A shared disk lock manager Group: System Environment/Base