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