Allow aug-ls to take Augeas variable as argument (RHBZ#580016).
[libguestfs.git] / daemon / mknod.c
index adaeb80..50865a6 100644 (file)
 #include "../src/guestfs_protocol.h"
 #include "daemon.h"
 #include "actions.h"
+#include "optgroups.h"
+
+#ifdef HAVE_MKNOD
+int
+optgroup_mknod_available (void)
+{
+  return 1;
+}
+#else
+int
+optgroup_mknod_available (void)
+{
+  return 0;
+}
+#endif
 
 int
 do_mknod (int mode, int devmajor, int devminor, const char *path)
 {
+#ifdef HAVE_MKNOD
   int r;
 
   CHROOT_IN;
@@ -40,11 +56,14 @@ do_mknod (int mode, int devmajor, int devminor, const char *path)
   CHROOT_OUT;
 
   if (r == -1) {
-    reply_with_perror ("mknod: %s", path);
+    reply_with_perror ("%s", path);
     return -1;
   }
 
   return 0;
+#else
+  NOT_AVAILABLE (-1);
+#endif
 }
 
 int