change strncmp() == 0 to STREQLEN()
[libguestfs.git] / daemon / fallocate.c
index f61c496..20a75e6 100644 (file)
 #include "actions.h"
 
 int
-do_fallocate (char *path, int len)
+do_fallocate (const char *path, int len)
 {
   int fd, r;
 
-  NEED_ROOT (-1);
-  ABS_PATH (path, return -1);
-
   CHROOT_IN;
   fd = open (path, O_WRONLY | O_CREAT | O_TRUNC | O_NOCTTY, 0666);
   CHROOT_OUT;
   if (fd == -1) {
-    reply_with_perror (path);
+    reply_with_perror ("failed to open %s", path);
     return -1;
   }