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:
parent
7f5e71fa73
commit
b79b965bd9
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user