Displaying 1 result from an estimated 1 matches for "gzip_mag".
Did you mean:
gzip_magic
2019 Jan 22
1
[PATCH] fix build failure when CONFIG_KLIBC_ZLIB is not set
...ons(+)
diff --git a/usr/kinit/initrd.c b/usr/kinit/initrd.c
index 7eece2ce..a8385a98 100644
--- a/usr/kinit/initrd.c
+++ b/usr/kinit/initrd.c
@@ -54,11 +54,14 @@ static int rd_copy_image(const char *path)
{
int ffd = open(path, O_RDONLY);
int rv = -1;
+#ifdef CONFIG_KLIBC_ZLIB
unsigned char gzip_magic[2];
+#endif
if (ffd < 0)
goto barf;
+#ifdef CONFIG_KLIBC_ZLIB
if (xpread(ffd, gzip_magic, 2, 0) == 2 &&
gzip_magic[0] == 037 && gzip_magic[1] == 0213) {
FILE *wfd = fopen("/dev/ram0", "w");
@@ -67,6 +70,9 @@ static int rd_copy_image(const...