pkgsrc/filesystems/libntfs/patches/patch-ntfsprogs_ntfsclone.c
adam 4cc423339b Changes 2014.2.15:
libntfs: added use of hd library to get the legacy BIOS geometry
libntfs: switched to /proc/mounts for checking existing mounts
libntfs: fixed usa checking by ntfsck on 4K sector disks
libntfs: fixed processing compressed data beyond file size (Windows 8 compliance)
libntfs: fixed expanding a resident attribute without inserting holes
libntfs: allow DACLs to not have any ACE
libntfs: ignore unmapped regions when checking whether sparse
libntfs: upgraded the Win32 interface for use with ntfsprogs
ntfsresize: enabled relocating the MFT when shrinking a volume
ntfsresize: fixed trying to update the MFT and Bitmap on a test run
ntfsresize: fixed updating all the MFT runs in a relocated MFT
ntfsresize: set the backup boot sector when the size is reliable
ntfsresize: reserved a single sector for the backup boot sector
ntfsundelete: output the modification time when scanning files
ntfsundelete: ported to Windows
ntfsclone: fixed wiping fragmented metadata when creating a metadata image
ntfsclone: allowed cloning a file system despite allocation errors
ntfsclone: fixed bad copying of the backup boot sector
ntfsclone: ported to Windows
ntfsdecrypt: made compatible with libgrypt-1.6
2014-05-19 12:22:06 +00:00

55 lines
1.5 KiB
C

$NetBSD: patch-ntfsprogs_ntfsclone.c,v 1.1 2014/05/19 12:22:06 adam Exp $
--- ntfsprogs/ntfsclone.c.orig 2014-02-15 14:07:52.000000000 +0000
+++ ntfsprogs/ntfsclone.c
@@ -68,6 +68,19 @@
*/
#define NTFS_DO_NOT_CHECK_ENDIANS
+#ifdef __NetBSD__
+# include <sys/param.h>
+ /* NetBSD versions later than 2.99.9 have statvfs(2) instead of statfs(2) */
+# if __NetBSD_Version__ >= 299000900
+# include <sys/statvfs.h>
+# define F_TYPE f_fsid
+# else
+# define F_TYPE f_type
+# endif
+#else
+# define F_TYPE f_type
+#endif
+
#include "debug.h"
#include "types.h"
#include "support.h"
@@ -161,8 +174,12 @@ static struct {
char *output;
char *volume;
#ifndef NO_STATFS
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900)
+ struct statvfs stfs;
+#else
struct statfs stfs;
#endif
+#endif
} opt;
struct bitmap {
@@ -818,7 +835,7 @@ static void copy_cluster(int rescue, u64
#ifndef NO_STATFS
int err = errno;
perr_printf("Write failed");
- if (err == EIO && opt.stfs.f_type == 0x517b)
+ if (err == EIO && opt.stfs.F_TYPE == 0x517b)
Printf("Apparently you tried to clone to a remote "
"Windows computer but they don't\nhave "
"efficient sparse file handling by default. "
@@ -2238,7 +2255,7 @@ static void set_filesize(s64 filesize)
Printf("WARNING: Couldn't get filesystem type: "
"%s\n", strerror(errno));
else
- fs_type = opt.stfs.f_type;
+ fs_type = opt.stfs.F_TYPE;
if (fs_type == 0x52654973)
Printf("WARNING: You're using ReiserFS, it has very poor "