ports/sysutils/e2fsprogs/files/patch-lib_blkid_getsize.c
Matthias Andree e628120d67 Fix build on HEAD since r276737 removed DIOCGDINFO.
The code path that preferred DIOCGMEDIASIZE has been there for years
(since FreeBSD 6.1 at the latest), but there was no guard that checked
DIOCGINFO in one of the two getsize.c files.
2015-01-11 11:44:11 +00:00

20 lines
629 B
C

--- lib/blkid/getsize.c.orig 2014-08-02 20:26:22 UTC
+++ lib/blkid/getsize.c
@@ -127,7 +127,7 @@ blkid_loff_t blkid_get_dev_size(int fd)
return (blkid_loff_t)this_floppy.size << 9;
}
#endif
-#ifdef HAVE_SYS_DISKLABEL_H
+#if defined(HAVE_SYS_DISKLABEL_H) && defined(DIOCGDINFO)
{
int part = -1;
struct disklabel lab;
@@ -154,7 +154,7 @@ blkid_loff_t blkid_get_dev_size(int fd)
return pp->p_size << 9;
}
}
-#endif /* HAVE_SYS_DISKLABEL_H */
+#endif /* defined(HAVE_SYS_DISKLABEL_H) && defined(DIOCGDINFO) */
{
#if defined(HAVE_FSTAT64) && !defined(__OSX_AVAILABLE_BUT_DEPRECATED)
struct stat64 st;