From e96dab80fe85fb308567dd7ea3c2a96195bb487a Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Mon, 25 Apr 2011 01:08:03 -0400 Subject: [PATCH] lseek() after ftruncate() just to be safe. --- ndhc/leasefile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ndhc/leasefile.c b/ndhc/leasefile.c index 1415592..99a40eb 100644 --- a/ndhc/leasefile.c +++ b/ndhc/leasefile.c @@ -1,5 +1,5 @@ /* leasefile.c - functions for writing the lease file - * Time-stamp: <2011-04-19 16:22:36 njk> + * Time-stamp: <2011-04-25 01:02:26 njk> * * (c) 2011 Nicholas J. Kain * @@ -70,6 +70,7 @@ void write_leasefile(struct in_addr ipnum) log_warning("Failed to truncate lease file.\n"); return; } + lseek(leasefilefd, 0, SEEK_SET); ret = safe_write(leasefilefd, ip, strlen(ip)); if (ret == -1) log_warning("Failed to write ip to lease file.\n");