Sophie

Sophie

distrib > Arklinux > devel > x86_64 > by-pkgid > 5b940e974faae500b8be8331a3cc5064 > files > 13

mkinitrd-5.0.17-24ark.src.rpm

--- mkinitrd-5.0.17/nash/nash.c.ark	2007-10-04 14:11:02.000000000 +0200
+++ mkinitrd-5.0.17/nash/nash.c	2007-10-04 14:22:48.000000000 +0200
@@ -24,6 +24,7 @@
    well, argument parsing is screwy. */
 
 #define _GNU_SOURCE 1
+#define _BSD_SOURCE 1
 
 #include <ctype.h>
 #include <dirent.h>
@@ -99,6 +100,21 @@
 
 #define MAX(a, b) ((a) > (b) ? a : b)
 
+#ifndef __GLIBC__
+/* dietlibc doesn't implement the glibc extension canonicalize_file_name(),
+ * and doesn't have the glibc extension that realpath(x, NULL) allocates a
+ * buffer either... So we emulate it here
+ */
+
+static inline char *canonicalize_file_name(const char *path)
+{
+	char *buf=malloc(PATH_MAX);
+	realpath(path, buf);
+	return buf;
+}
+
+#endif
+
 static int testing = 0, quiet = 0, reallyquiet = 0;
 static char *gotoLabel = NULL;
 
--- mkinitrd-5.0.17/grubby/grubby.c.ark	2007-10-04 14:27:24.000000000 +0200
+++ mkinitrd-5.0.17/grubby/grubby.c	2007-10-04 14:27:43.000000000 +0200
@@ -24,6 +24,7 @@
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h> // strncasecmp() for dietlibc
 #include <sys/stat.h>
 #include <unistd.h>