Update 0.4 --> 0.5.
This commit is contained in:
parent
c9bb38b874
commit
3626d99b5f
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=323840
@ -6,8 +6,7 @@
|
||||
#
|
||||
|
||||
PORTNAME= hdrecover
|
||||
PORTVERSION= 0.4
|
||||
PORTREVISION= 1
|
||||
PORTVERSION= 0.5
|
||||
CATEGORIES= sysutils
|
||||
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (hdrecover-0.4.tar.gz) = 609a0755dbda744e3dc89bffd1c673fd5c370448aa43e426d90ff35faa74a20d
|
||||
SIZE (hdrecover-0.4.tar.gz) = 85409
|
||||
SHA256 (hdrecover-0.5.tar.gz) = 5daa11caaa8c597778a4a7a76b022372ddb315a90c527405972a2380668ad3f8
|
||||
SIZE (hdrecover-0.5.tar.gz) = 86486
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- hdrecover.cpp.orig 2011-09-25 04:48:10.000000000 -0700
|
||||
+++ hdrecover.cpp 2012-06-29 16:02:39.000000000 -0700
|
||||
@@ -26,7 +26,11 @@
|
||||
--- hdrecover.cpp.orig 2013-07-27 04:37:04.000000000 -0700
|
||||
+++ hdrecover.cpp 2013-07-28 08:04:06.970389678 -0700
|
||||
@@ -26,12 +26,20 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
@ -12,7 +12,63 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
@@ -260,7 +264,7 @@
|
||||
#include <sys/ioctl.h>
|
||||
+#ifdef __FreeBSD_cc_version
|
||||
+static int secsize = 0; /* the sensed sector size */
|
||||
+#else
|
||||
#include <linux/fs.h>
|
||||
+#endif
|
||||
|
||||
int badblocks = 0;
|
||||
int recovered = 0;
|
||||
@@ -47,6 +55,34 @@
|
||||
|
||||
unsigned long long length = 0;
|
||||
|
||||
+#ifdef __FreeBSD_cc_version
|
||||
+static ssize_t
|
||||
+get_sec_size()
|
||||
+{
|
||||
+
|
||||
+#define MAX_SEC_SIZE 2048 /* maximum section size that is supported */
|
||||
+#define MIN_SEC_SIZE 512 /* the sector size to start sensing at */
|
||||
+
|
||||
+ char buf[MAX_SEC_SIZE];
|
||||
+
|
||||
+ lseek(fd, (0), 0);
|
||||
+ if (secsize == 0)
|
||||
+ for (secsize = MIN_SEC_SIZE; secsize <= MAX_SEC_SIZE;
|
||||
+ secsize *= 2) {
|
||||
+ /* try the read */
|
||||
+ int size = read(fd, buf, secsize);
|
||||
+ if (size == secsize)
|
||||
+ /* it worked so return */
|
||||
+ return secsize;
|
||||
+ }
|
||||
+ else
|
||||
+ return read(fd, buf, secsize);
|
||||
+
|
||||
+ /* we failed to read at any of the sizes */
|
||||
+ return -1;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
int correctsector(unsigned long long sectornum)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -178,7 +214,11 @@
|
||||
return 1;
|
||||
}
|
||||
|
||||
+#ifdef __FreeBSD_cc_version
|
||||
+ if ((phys_block_size = get_sec_size()) == -1) {
|
||||
+#else
|
||||
if (ioctl(fd, BLKPBSZGET, &phys_block_size) == -1) {
|
||||
+#endif
|
||||
printf("Failed to get physical block size of device\n");
|
||||
return 1;
|
||||
}
|
||||
@@ -268,7 +308,7 @@
|
||||
sprintf(p, "%d seconds", remaining);
|
||||
}
|
||||
printf("Sector %Ld (%02d%%) ETR: %s\n",
|
||||
|
Loading…
Reference in New Issue
Block a user