libudev is optional to use this repository. Packages can require it if
desired, but others downloading the repo should still be able to use
most of the functionality this tool provides without it.
Signed-off-by: Keith Busch <keith.busch@intel.com>
#include <stdint.h>
#include <unistd.h>
#include <sys/ioctl.h>
+#ifdef LIBUDEV_EXISTS
#include <libudev.h>
+#endif
#include <linux/types.h>
return 0;
}
+#ifdef LIBUDEV_EXISTS
static int disconnect_subsys(struct udev_enumerate *enumerate, char *nqn)
{
struct udev_list_entry *list_entry;
exit:
return ret;
}
+#else
+static int disconnect_by_nqn(char *nqn)
+{
+ fprintf(stderr,"libudev not detected, install and rebuild.\n");
+ return -1;
+}
+#endif
static int disconnect_by_device(char *device)
{