From a0aee5f0113d4e39f838b13ac83e584f9d891cb7 Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Tue, 11 Jun 1996 08:14:28 +0000 Subject: [PATCH] Report failure in the event of a lease conflict; notice if lease database rewrite fails --- common/memory.c | 4 +++- memory.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/memory.c b/common/memory.c index 5d4883c3..13bc9b21 100644 --- a/common/memory.c +++ b/common/memory.c @@ -400,6 +400,7 @@ int supersede_lease (comp, lease, commit) comp -> hardware_addr.hlen))))) { warn ("Lease conflict at %s", piaddr (comp -> ip_addr)); + return 0; } else { /* If there's a Unique ID, dissociate it from the hash table if necessary, and always free it. */ @@ -650,7 +651,8 @@ void write_leases () write_lease (l); } } - commit_leases (); + if (!commit_leases ()) + error ("Can't commit leases to new database: %m"); } void dump_subnets () diff --git a/memory.c b/memory.c index 5d4883c3..13bc9b21 100644 --- a/memory.c +++ b/memory.c @@ -400,6 +400,7 @@ int supersede_lease (comp, lease, commit) comp -> hardware_addr.hlen))))) { warn ("Lease conflict at %s", piaddr (comp -> ip_addr)); + return 0; } else { /* If there's a Unique ID, dissociate it from the hash table if necessary, and always free it. */ @@ -650,7 +651,8 @@ void write_leases () write_lease (l); } } - commit_leases (); + if (!commit_leases ()) + error ("Can't commit leases to new database: %m"); } void dump_subnets ()