fsync() the leasefile after writing a new lease IP so that it's instantly

updated to disk.
This commit is contained in:
Nicholas J. Kain 2011-06-28 13:47:36 -04:00
parent ac38a15c9f
commit d1f36cf75e

View File

@ -74,4 +74,6 @@ void write_leasefile(struct in_addr ipnum)
ret = safe_write(leasefilefd, ip, strlen(ip)); ret = safe_write(leasefilefd, ip, strlen(ip));
if (ret == -1) if (ret == -1)
log_warning("Failed to write ip to lease file.\n"); log_warning("Failed to write ip to lease file.\n");
else
fsync(leasefilefd);
} }