projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ramips: add support for the Senao/EnGenius ESR-9753 board
[openwrt.git]
/
tools
/
include
/
getline.h
diff --git
a/tools/include/getline.h
b/tools/include/getline.h
index
219be75
..
02df6c2
100644
(file)
--- a/
tools/include/getline.h
+++ b/
tools/include/getline.h
@@
-27,12
+27,12
@@
* SUCH DAMAGE.
*/
* SUCH DAMAGE.
*/
-#ifndef __linux__
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#if !defined(__linux__) && !(defined(__APPLE__) && __DARWIN_C_LEVEL >= 200809L)
/*
* Emulate glibc getline() via BSD fgetln().
* Note that outsize is not changed unless memory is allocated.
/*
* Emulate glibc getline() via BSD fgetln().
* Note that outsize is not changed unless memory is allocated.
@@
-40,10
+40,16
@@
static inline ssize_t
getline(char **outbuf, size_t *outsize, FILE *fp)
{
static inline ssize_t
getline(char **outbuf, size_t *outsize, FILE *fp)
{
- char *buf;
size_t len;
size_t len;
+#ifndef __CYGWIN__
+ char *buf;
buf = fgetln(fp, &len);
buf = fgetln(fp, &len);
+#else
+ char buf[512];
+ fgets(buf, sizeof(buf), fp);
+ len = strlen(buf);
+#endif
if (buf == NULL)
return (-1);
if (buf == NULL)
return (-1);
This page took
0.026366 seconds
and
4
git commands to generate.