pkgsrc/security/tct/patches/patch-ag

56 lines
1.4 KiB
Text

$NetBSD: patch-ag,v 1.4 2015/03/19 08:34:53 dholland Exp $
Fix Linux off_t handling.
Add NetBSD support.
--- src/fstools/fs_tools.h.orig 2001-09-07 10:06:57.000000000 -0700
+++ src/fstools/fs_tools.h
@@ -182,14 +182,20 @@ extern int optind;
* Linux 2.whatever. We'll see how stable the interfaces are.
*/
#if defined(LINUX2)
+#define _FILE_OFFSET_BITS 64
#define SUPPORTED
#include <linux/ext2_fs.h>
#define HAVE_EXT2FS
+#if 0
#define USE_MYLSEEK
#define HAVE_LLSEEK
-#define HAVE_DTIME
#define LSEEK mylseek
#define OFF_T long long
+#else
+#define LSEEK lseek
+#define OFF_T off_t
+#endif
+#define HAVE_DTIME
#define STRTOUL strtoul
#define DADDR_T __u32
#define EXT2FS_TYPE "ext2fs"
@@ -203,6 +203,26 @@ extern int optind;
#endif
#endif
+#if defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD7)
+#define SUPPORTED
+#define HAVE_UFS_FFS
+#include <sys/vnode.h>
+#include <ufs/ufs/quota.h>
+#include <ufs/ufs/inode.h>
+#include <ufs/ufs/ufs_bswap.h>
+#include <ufs/ffs/fs.h>
+#define LSEEK lseek
+#define OFF_T off_t
+#define STRTOUL strtoul
+#define itod(fs,i) ino_to_fsba(fs,i)
+#define itoo(fs,i) ino_to_fsbo(fs,i)
+#define INOTIME(t) (t)
+#define DADDR_T daddr_t
+#define UFS_TYPE "ufs"
+#define DEF_FSTYPE UFS_TYPE
+#define INO_TO_CG ino_to_cg
+#endif
+
/*
* Catch-all.
*/