Rename getline to get_line so we don't conflict with crappy GNU headers that wrongly expose getline when _GNU_SOURCE isn't set. Bug #17.

This commit is contained in:
Roy Marples 2008-02-06 10:18:03 +00:00
parent c737e99e65
commit 2136d44495
5 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@
/* Handy routine to read very long lines in text files.
* This means we read the whole line and avoid any nasty buffer overflows. */
char *getline (FILE *fp)
char *get_line (FILE *fp)
{
char *line = NULL;
char *p;

View File

@ -53,7 +53,7 @@ void srandomdev (void);
#endif
void close_fds (void);
char *getline (FILE *fp);
char *get_line (FILE *fp);
int get_time (struct timeval *tp);
time_t uptime (void);
void writepid (int fd, pid_t pid);

View File

@ -285,7 +285,7 @@ static int _make_ntp (const char *file, const char *ifname, const dhcp_t *dhcp)
return (-1);
}
} else {
while (tomatch != 0 && (line = getline (f))) {
while (tomatch != 0 && (line = get_line (f))) {
struct in_addr addr;
a = line;

2
duid.c
View File

@ -60,7 +60,7 @@ size_t get_duid (unsigned char *duid, const interface_t *iface)
/* If we already have a DUID then use it as it's never supposed
* to change once we have one even if the interfaces do */
if ((f = fopen (DUIDFILE, "r"))) {
char *line = getline (f);
char *line = get_line (f);
if (line) {
len = hwaddr_aton (NULL, line);
if (len && len <= DUID_LEN)

2
info.c
View File

@ -333,7 +333,7 @@ bool read_info (const interface_t *iface, dhcp_t *dhcp)
dhcp->frominfo = true;
while ((line = getline (fp))) {
while ((line = get_line (fp))) {
var = line;
/* Strip leading spaces/tabs */