Fix warnings in leasefile.c.

This commit is contained in:
Nicholas J. Kain 2014-03-10 19:42:52 -04:00
parent d18aff8fb0
commit 151ed60de1
2 changed files with 13 additions and 6 deletions

View File

@ -1,6 +1,6 @@
/* leasefile.c - functions for writing the lease file /* leasefile.c - functions for writing the lease file
* *
* Copyright (c) 2011 Nicholas J. Kain <njkain at gmail dot com> * Copyright (c) 2011-2014 Nicholas J. Kain <njkain at gmail dot com>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -36,6 +36,7 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include "leasefile.h"
#include "log.h" #include "log.h"
#include "strl.h" #include "strl.h"
#include "io.h" #include "io.h"
@ -49,7 +50,7 @@ void set_leasefile(char *lf)
strnkcpy(leasefile, lf, sizeof leasefile); strnkcpy(leasefile, lf, sizeof leasefile);
} }
void open_leasefile() void open_leasefile(void)
{ {
if (strlen(leasefile) > 0) { if (strlen(leasefile) > 0) {
leasefilefd = open(leasefile, O_WRONLY|O_TRUNC|O_CREAT, 0644); leasefilefd = open(leasefile, O_WRONLY|O_TRUNC|O_CREAT, 0644);

View File

@ -1,6 +1,6 @@
/* leasefile.h - functions for writing the lease file /* leasefile.h - functions for writing the lease file
* *
* Copyright (c) 2011 Nicholas J. Kain <njkain at gmail dot com> * Copyright (c) 2011-2014 Nicholas J. Kain <njkain at gmail dot com>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -26,6 +26,12 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
void set_leasefile(char *lf); #ifndef NJK_NDHC_LEASEFILE_H_
void open_leasefile(); #define NJK_NDHC_LEASEFILE_H_
void write_leasefile(struct in_addr ipnum);
extern void set_leasefile(char *lf);
extern void open_leasefile(void);
extern void write_leasefile(struct in_addr ipnum);
#endif /* NJK_NDHC_LEASEFILE_H_ */