summaryrefslogtreecommitdiffstats
path: root/tools/include/getline.h
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-04-14 14:54:34 +0000
committerFlorian Fainelli <florian@openwrt.org>2009-04-14 14:54:34 +0000
commitb8e09787fac3a13854e53e3a7a6707d39563ae68 (patch)
tree3eb743e2a7927e7becd57c53629133cf5f22ed18 /tools/include/getline.h
parentbda5e955744bf3997870c921efba90bea6f60118 (diff)
downloadmaster-31e0f0ae-b8e09787fac3a13854e53e3a7a6707d39563ae68.tar.gz
master-31e0f0ae-b8e09787fac3a13854e53e3a7a6707d39563ae68.tar.bz2
master-31e0f0ae-b8e09787fac3a13854e53e3a7a6707d39563ae68.zip
more cygwin related build fixes
SVN-Revision: 15227
Diffstat (limited to 'tools/include/getline.h')
-rw-r--r--tools/include/getline.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/include/getline.h b/tools/include/getline.h
index 219be75204..b9a3f7150f 100644
--- a/tools/include/getline.h
+++ b/tools/include/getline.h
@@ -40,10 +40,16 @@
static inline ssize_t
getline(char **outbuf, size_t *outsize, FILE *fp)
{
- char *buf;
size_t len;
+#ifndef __CYGWIN__
+ char *buf;
buf = fgetln(fp, &len);
+#else
+ char buf[512];
+ fgets(buf, sizeof(buf), fp);
+ len = strlen(buf);
+#endif
if (buf == NULL)
return (-1);