* Allow adding symlinks to lvm's dev-cache by translating the symlink
for udev/libdevattr.
* Don't include kdev_t.h in libdm since it has the wrong macros for
MAJOR and MINOR; instead include netbsd's version.
Reported-by: Matt Dillon (dillon@)
return_0;
}
#elif defined(__DragonFly__)
- /*
- * This never happens, but oh well...
- */
if (dragonfly_check_dev(MAJOR(info.st_rdev),path) < 0) {
log_debug("%s: Device not added to cache", path);
return_0;
#include <sys/param.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <sys/sysctl.h>
struct udev_list_entry *udev_le, *udev_le_first;
struct udev_monitor *udev_monitor;
struct udev_device *udev_dev;
+ struct stat sb;
const char *subsystem;
const char *driver;
const char *type;
result = LVM_FAILURE;
+ /*
+ * We do the stat & devname dance to get around paths that are
+ * symlinks. udev will only find devices by their real name or
+ * devfs alias.
+ */
+ stat(path, &sb);
+ path = devname(sb.st_rdev, S_IFCHR);
+
if (!strncmp(path, "/dev/", strlen("/dev/"))) {
path += strlen("/dev/");
}
#include "dmlib.h"
#include "libdm-targets.h"
#include "libdm-common.h"
-#include "kdev_t.h"
+#include "libdm-netbsd.h"
#include "dm-ioctl.h"
#include <stdarg.h>