Fix compilation issue on FreeBSD (bug #12841)

Hide getline call by checking for glibc. If not, use fgetln instead. Even
though this section is now #ifdef'ed for linux only, this should help make
it more portable if non-linux folks end up wanting it.
This commit is contained in:
David Nusinow 2007-10-21 23:46:54 -04:00
parent 7f5e71fa73
commit b79b965bd9

View File

@ -366,7 +366,11 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip
goto end;
}
/* Read the file */
#ifdef __GLIBC__
while ((read = getline(&line, &len, fp)) != -1) {
#else
while ((line = fgetln(fp, &len)) != (char *)NULL) {
#endif /* __GLIBC __ */
xchomp(line);
if (isdigit(line[0])) {
strncpy(vendor_str, line, 4);