Annoying changes to work on Sun boxes.
diff --git a/src/lib9/_p9dir.c b/src/lib9/_p9dir.c
index 459bd15..0903c57 100644
--- a/src/lib9/_p9dir.c
+++ b/src/lib9/_p9dir.c
@@ -1,13 +1,15 @@
-#include <u.h>
-#define NOPLAN9DEFINES
-#include <libc.h>
-
#include <sys/stat.h>
+#ifdef _HAVEDISKLABEL
#include <sys/disklabel.h>
+#endif
#include <dirent.h>
#include <pwd.h>
#include <grp.h>
+#include <u.h>
+#define NOPLAN9DEFINES
+#include <libc.h>
+
int
_p9dir(struct stat *st, char *name, Dir *d, char **str, char *estr)
{
@@ -83,7 +85,9 @@
d->muid = "";
d->qid.path = ((uvlong)st->st_dev<<32) | st->st_ino;
+#ifdef _HAVESTGEN
d->qid.vers = st->st_gen;
+#endif
d->mode = st->st_mode&0777;
d->atime = st->st_atime;
d->mtime = st->st_mtime;
@@ -96,6 +100,7 @@
}
/* fetch real size for disks */
+#ifdef _HAVEDISKLABEL
if(S_ISCHR(st->st_mode)){
int fd, n;
struct disklabel lab;
@@ -114,6 +119,7 @@
if(fd >= 0)
close(fd);
}
+#endif
}
return sz;