aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornork <nork@FreeBSD.org>2006-08-12 20:33:13 +0800
committernork <nork@FreeBSD.org>2006-08-12 20:33:13 +0800
commit2ed40ae1d44692172461a925a1558c878e23590c (patch)
tree644891281d0730297374d64c6ce8b0e68d462247
parentde42d29a2ca0d094eb4b49de740d6e74036078fc (diff)
downloadfreebsd-ports-gnome-2ed40ae1d44692172461a925a1558c878e23590c.tar.gz
freebsd-ports-gnome-2ed40ae1d44692172461a925a1558c878e23590c.tar.zst
freebsd-ports-gnome-2ed40ae1d44692172461a925a1558c878e23590c.zip
Get media size by DIOCGMEDIASIZE ioctl(2).
# dd if=/dev/zero of=/var/tmp/reiserfs.img bs=1m count=64 # mdconfig -a -t vnode -f /var/tmp/reiserfs.img # mkfs.reiserfs -q /dev/md0. Obtained from: src/sbin/newfs/newfs.c
-rw-r--r--sysutils/progsreiserfs/Makefile2
-rw-r--r--sysutils/progsreiserfs/files/patch-libdal-file.c26
2 files changed, 27 insertions, 1 deletions
diff --git a/sysutils/progsreiserfs/Makefile b/sysutils/progsreiserfs/Makefile
index edb4372bae1c..43baafe200a0 100644
--- a/sysutils/progsreiserfs/Makefile
+++ b/sysutils/progsreiserfs/Makefile
@@ -7,7 +7,7 @@
PORTNAME= progsreiserfs
PORTVERSION= 0.3.1.r8
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= sysutils
MASTER_SITES= http://www.cgsecurity.org/
DISTNAME= ${PORTNAME}-${PORTVERSION:S/.r/-rc/}
diff --git a/sysutils/progsreiserfs/files/patch-libdal-file.c b/sysutils/progsreiserfs/files/patch-libdal-file.c
new file mode 100644
index 000000000000..82a52fc6e393
--- /dev/null
+++ b/sysutils/progsreiserfs/files/patch-libdal-file.c
@@ -0,0 +1,26 @@
+--- libdal/file.c.orig Thu Dec 12 21:32:34 2002
++++ libdal/file.c Sat Aug 12 15:35:27 2006
+@@ -14,6 +14,7 @@
+
+ #if defined(__freebsd__)
+ # define O_LARGEFILE 0
++# include <sys/disk.h>
+ #endif
+
+ #ifndef DJGPP
+@@ -154,6 +155,15 @@
+
+ #endif
+
++#ifdef DIOCGMEDIASIZE
++
++ if (ioctl(*((int *)dal->entity), DIOCGMEDIASIZE, &size) >= 0)
++ return (count_t)(size / dal->blocksize);
++
++ file_save_error(dal);
++
++#endif
++
+ if ((max_off = lseek(*((int *)dal->entity), 0, SEEK_END)) == (off_t)-1) {
+ file_save_error(dal);
+ return 0;