2010-01-10 20:42:12 +02:00
|
|
|
--- a/tools/kwbimage.c
|
|
|
|
+++ b/tools/kwbimage.c
|
2010-07-22 05:43:44 +03:00
|
|
|
@@ -206,6 +206,30 @@ INVL_DATA:
|
2010-01-10 20:42:12 +02:00
|
|
|
exit (EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifndef __GLIBC__
|
2010-07-22 05:43:44 +03:00
|
|
|
+#ifndef __FreeBSD__
|
2010-01-10 20:42:12 +02:00
|
|
|
+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
|
2010-07-22 05:43:44 +03:00
|
|
|
+#endif
|
2010-01-10 20:42:12 +02:00
|
|
|
+
|
|
|
|
/*
|
|
|
|
* this function sets the kwbimage header by-
|
|
|
|
* 1. Abstracting input command line arguments data
|
2010-07-22 05:43:44 +03:00
|
|
|
--- a/include/image.h
|
|
|
|
+++ b/include/image.h
|
2010-12-23 02:07:58 +02:00
|
|
|
@@ -50,6 +50,10 @@
|
2010-07-22 05:43:44 +03:00
|
|
|
|
|
|
|
#endif /* USE_HOSTCC */
|
|
|
|
|
|
|
|
+#ifndef ulong
|
|
|
|
+#define ulong unsigned long
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#if defined(CONFIG_FIT)
|
2010-12-23 02:07:58 +02:00
|
|
|
#include <fdt.h>
|
|
|
|
#include <libfdt.h>
|