diff --git a/external/gpl2/lvm2/dist/lib/device/dev-cache.c b/external/gpl2/lvm2/dist/lib/device/dev-cache.c index 5943e6593836..c294a5b9bd04 100644 --- a/external/gpl2/lvm2/dist/lib/device/dev-cache.c +++ b/external/gpl2/lvm2/dist/lib/device/dev-cache.c @@ -1,4 +1,4 @@ -/* $NetBSD: dev-cache.c,v 1.2 2008/12/22 00:56:58 haad Exp $ */ +/* $NetBSD: dev-cache.c,v 1.3 2009/10/16 21:00:41 joerg Exp $ */ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. @@ -435,11 +435,14 @@ static int _insert(const char *path, int rec) * raw and block. I can insert only existing * raw and block device. */ - if (nbsd_check_dev(MAJOR(info.st_rdev),path) < 0) { - log_debug("%s: Not a block device.", path); + if (S_ISBLK(info.st_mode)) { + log_debug("%s: Not a raw device", path); + return_0; + } + if (nbsd_check_dev(MAJOR(info.st_rdev),path) < 0) { + log_debug("%s: Not a known raw device", path); return_0; } - #else if (!S_ISBLK(info.st_mode)) log_debug("%s: Not a block device", path); diff --git a/external/gpl2/lvm2/dist/lib/netbsd/dev.c b/external/gpl2/lvm2/dist/lib/netbsd/dev.c index e8a862979855..e19de0ae4c3a 100644 --- a/external/gpl2/lvm2/dist/lib/netbsd/dev.c +++ b/external/gpl2/lvm2/dist/lib/netbsd/dev.c @@ -1,4 +1,4 @@ -/* $NetBSD: dev.c,v 1.1 2008/12/22 00:56:59 haad Exp $ */ +/* $NetBSD: dev.c,v 1.2 2009/10/16 21:00:41 joerg Exp $ */ /* * NetBSD specific device routines are added to this file. @@ -61,11 +61,7 @@ nbsd_check_dev(int major, const char *path) if (kd[i].d_cmajor != -1 && kd[i].d_bmajor != -1) { if (kd[i].d_cmajor == major) - return kd[i].d_bmajor; - - if (kd[i].d_bmajor == major) - return kd[i].d_cmajor; - + return 0; } return LVM_FAILURE;