diff --git a/src/lib9/_p9dir.c b/src/lib9/_p9dir.c index 517dc773..555d20d0 100644 --- a/src/lib9/_p9dir.c +++ b/src/lib9/_p9dir.c @@ -10,6 +10,10 @@ #if defined(__FreeBSD__) || defined(__OpenBSD__) #include #include +#define _HAVEDISKLABEL +#endif + +#if defined(__OpenBSD__) static int diskdev[] = { 151, /* aacd */ 116, /* ad */ @@ -41,9 +45,44 @@ isdisk(struct stat *st) return 1; return 0; } -#define _HAVEDISKLABEL #endif +#if defined(__FreeBSD__) /* maybe OpenBSD too? */ +char *diskdev[] = { + "aacd", + "ad", + "ar", + "afd", + "amrd", + "da", + "fla", + "idad", + "md", + "mlxd", + "pst", + "twed", + "vn", + "wd", + "wfd", + "da", +}; +static int +isdisk(struct stat *st) +{ + char *name; + int i; + + if(!S_ISCHR(st->st_mode)) + return 0; + name = devname(st->st_rdev, S_IFCHR); + for(i=0; i #include