summaryrefslogtreecommitdiff
path: root/sysutils/progsreiserfs/files/patch-libdal-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/progsreiserfs/files/patch-libdal-file.c')
-rw-r--r--sysutils/progsreiserfs/files/patch-libdal-file.c26
1 files changed, 26 insertions, 0 deletions
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;