summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Nusinow <dnusinow@debian.org>2007-10-21 23:46:54 -0400
committerDavid Nusinow <dnusinow@debian.org>2007-10-21 23:46:54 -0400
commitb79b965bd9a96f79781e85c0428068caa1ba381b (patch)
tree13de37c49f5c930e16cb66eba559ff4b7b72f71a
parent7f5e71fa7347fb4ec2657ccc453831c04a0f288d (diff)
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.
-rw-r--r--hw/xfree86/common/xf86AutoConfig.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index 524e14eb5..efaf45fb8 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -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);