X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=package%2Fuboot-lantiq%2Fpatches%2F200-portability.patch;fp=package%2Fuboot-lantiq%2Fpatches%2F200-portability.patch;h=ae38ad68eaec06f618dc24153dbc815d1de2efb9;hb=60c60c05163b1d4d44fefef49caaac9dbc9f8a8f;hp=0000000000000000000000000000000000000000;hpb=6e5419b7acc217c83d410775ae3d71d37efdaa91;p=openwrt%2Fopenwrt.git diff --git a/package/uboot-lantiq/patches/200-portability.patch b/package/uboot-lantiq/patches/200-portability.patch new file mode 100644 index 0000000000..ae38ad68ea --- /dev/null +++ b/package/uboot-lantiq/patches/200-portability.patch @@ -0,0 +1,31 @@ +--- a/tools/kwbimage.c ++++ b/tools/kwbimage.c +@@ -206,6 +206,28 @@ INVL_DATA: + exit (EXIT_FAILURE); + } + ++#ifndef __GLIBC__ ++static ssize_t ++getline(char **line, size_t *len, FILE *fd) ++{ ++ char *tmp; ++ int tmplen; ++ ++ tmp = fgetln(fd, &tmplen); ++ if (!tmp) ++ return -1; ++ ++ if (!*line || tmplen > *len) { ++ *len = tmplen + 1; ++ *line = realloc(*line, *len); ++ } ++ ++ strncpy(*line, tmp, tmplen); ++ line[tmplen] = 0; ++ return tmplen; ++} ++#endif ++ + /* + * this function sets the kwbimage header by- + * 1. Abstracting input command line arguments data