daemon: Missing #includes revealed by cross-compiling.
[libguestfs.git] / daemon / initrd.c
index e703481..9c92fee 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <limits.h>
 #include <unistd.h>
 
 #include "../src/guestfs_protocol.h"
@@ -28,7 +29,7 @@
 #include "actions.h"
 
 char **
-do_initrd_list (char *path)
+do_initrd_list (const char *path)
 {
   FILE *fp;
   char *cmd;
@@ -37,9 +38,6 @@ do_initrd_list (char *path)
   int size = 0, alloc = 0;
   size_t len;
 
-  NEED_ROOT (NULL);
-  ABS_PATH (path, return NULL);
-
   /* "zcat /sysroot/<path> | cpio --quiet -it", but path must be quoted. */
   if (asprintf_nowarn (&cmd, "zcat %R | cpio --quiet -it", path) == -1) {
     reply_with_perror ("asprintf");