Our CI started to enable udev backend on FreeBSD. And while there
is udev on FreeBSD some parts of our code are highly Linux
specific, e.g. translating SCSI device type to string (from an
integer obtained from the sysfs). Obviously, this doesn't work
anywhere else. This is the reason why we need to include
scsi/scsi.h header file (which actually comes from the Linux
kernel source tree but for some reason glibc started to
distribute it, followed by musl).
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
#include <gio/gio.h>
#include <libudev.h>
#include <pciaccess.h>
-#include <scsi/scsi.h>
+#ifdef __linux__
+# include <scsi/scsi.h>
+#endif
#include "node_device_conf.h"
#include "node_device_event.h"
*typestring = NULL;
+#ifdef __linux__
+ /* These values are Linux specific. */
switch (type) {
case TYPE_DISK:
*typestring = g_strdup("disk");
foundtype = 0;
break;
}
+#else
+ /* Implement me. */
+ foundtype = 0;
+#endif
if (*typestring == NULL) {
if (foundtype == 1) {