From b79b965bd9a96f79781e85c0428068caa1ba381b Mon Sep 17 00:00:00 2001 From: David Nusinow Date: Sun, 21 Oct 2007 23:46:54 -0400 Subject: [PATCH] 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. --- hw/xfree86/common/xf86AutoConfig.c | 4 ++++ 1 file changed, 4 insertions(+) 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);