]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Record the time of the db_startup rewrite of the lease file so that we don't rewrite...
authorTed Lemon <source@isc.org>
Thu, 6 Mar 1997 23:41:27 +0000 (23:41 +0000)
committerTed Lemon <source@isc.org>
Thu, 6 Mar 1997 23:41:27 +0000 (23:41 +0000)
server/db.c

index ffc1966763ec2340cefe2a565727e2a64fadc66d..4882aa41a40ef6ca0f5945e5b2ee3b9fc7994601 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: db.c,v 1.9 1997/03/06 19:29:39 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: db.c,v 1.10 1997/03/06 23:41:27 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -176,6 +176,7 @@ void db_startup ()
        /* Read in the existing lease file... */
        read_leases ();
 
+       GET_TIME (&write_time);
        new_lease_file ();
 }
 
@@ -191,8 +192,8 @@ void new_lease_file ()
        }
 
        /* Make a temporary lease file... */
-       time (&t);
-       sprintf (newfname, "%s.%d", path_dhcpd_db, (int) (t & 32767));
+       GET_TIME (&t);
+       sprintf (newfname, "%s.%d", path_dhcpd_db, (int)t);
        if ((db_file = fopen (newfname, "w")) == NULL) {
                error ("Can't start new lease file: %m");
        }