~ubuntu-branches/debian/jessie/ufsutils/jessie

« back to all changes in this revision

Viewing changes to debian/patches/01_libufs.patch

  • Committer: Package Import Robot
  • Author(s): Robert Millan
  • Date: 2013-11-29 14:21:12 UTC
  • mfrom: (11.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20131129142112-5tz5g7a4b6prb0dt
Tags: 9.2-2
* Avoid kfreebsd-kernel-headers versions prior to ino_t fix.
* Remove gratuitous dependency on libtermcap / libtinfo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
---
2
 
 lib/libufs/block.c   |    2 ++
3
 
 lib/libufs/type.c    |    4 +++-
4
 
 sys/ufs/ffs/fs.h     |    5 ++++-
5
 
 sys/ufs/ufs/dinode.h |    2 ++
6
 
 sys/ufs/ufs/dir.h    |    2 ++
7
 
 5 files changed, 13 insertions(+), 2 deletions(-)
8
 
 
9
 
--- a/lib/libufs/type.c
10
 
+++ b/lib/libufs/type.c
11
 
@@ -111,7 +111,7 @@ again:      if ((ret = stat(name, &st)) < 0)
12
 
        if (ret >= 0 && S_ISREG(st.st_mode)) {
13
 
                /* Possibly a disk image, give it a try.  */
14
 
                ;
15
 
-       } else if (ret >= 0 && S_ISCHR(st.st_mode)) {
16
 
+       } else if (ret >= 0 && (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))) {
17
 
                /* This is what we need, do nothing. */
18
 
                ;
19
 
        } else if ((fs = getfsfile(name)) != NULL) {
20
 
@@ -134,8 +134,10 @@ again:     if ((ret = stat(name, &st)) < 0)
21
 
                        ERROR(disk, "could not find special device");
22
 
                        return (-1);
23
 
                }
24
 
+#if HAVE_BSD_STATFS
25
 
                strlcpy(dev, sfs.f_mntfromname, sizeof(dev));
26
 
                name = dev;
27
 
+#endif
28
 
        } else {
29
 
                ERROR(disk, "could not find special device");
30
 
                return (-1);
31
 
--- a/sys/ufs/ffs/fs.h
32
 
+++ b/sys/ufs/ffs/fs.h
33
 
@@ -33,6 +33,9 @@
34
 
 #ifndef _UFS_FFS_FS_H_
35
 
 #define _UFS_FFS_FS_H_
36
 
 
37
 
+#include <sys/types.h>
38
 
+#include <stdint.h>
39
 
+
40
 
 /*
41
 
  * Each disk drive contains some number of filesystems.
42
 
  * A filesystem consists of a number of cylinder groups.
43
 
@@ -504,7 +507,7 @@ struct cg {
44
 
  * Turn filesystem block numbers into disk block addresses.
45
 
  * This maps filesystem blocks to device size blocks.
46
 
  */
47
 
-#define        fsbtodb(fs, b)  ((daddr_t)(b) << (fs)->fs_fsbtodb)
48
 
+#define        fsbtodb(fs, b)  (((intmax_t)(b)) << (fs)->fs_fsbtodb)
49
 
 #define        dbtofsb(fs, b)  ((b) >> (fs)->fs_fsbtodb)
50
 
 
51
 
 /*
52
 
--- a/sys/ufs/ufs/dinode.h
53
 
+++ b/sys/ufs/ufs/dinode.h
54
 
@@ -68,6 +68,8 @@
55
 
 #ifndef _UFS_UFS_DINODE_H_
56
 
 #define        _UFS_UFS_DINODE_H_
57
 
 
58
 
+#include <sys/types.h>
59
 
+
60
 
 /*
61
 
  * The root inode is the root of the filesystem.  Inode 0 can't be used for
62
 
  * normal purposes and historically bad blocks were linked to inode 1, thus
63
 
--- a/sys/ufs/ufs/dir.h
64
 
+++ b/sys/ufs/ufs/dir.h
65
 
@@ -38,6 +38,8 @@
66
 
 #ifndef _UFS_UFS_DIR_H_
67
 
 #define        _UFS_UFS_DIR_H_
68
 
 
69
 
+#include <sys/types.h>
70
 
+
71
 
 /*
72
 
  * Theoretically, directories can be more than 2Gb in length, however, in
73
 
  * practice this seems unlikely. So, we define the type doff_t as a 32-bit
74
 
--- a/lib/libufs/block.c
75
 
+++ b/lib/libufs/block.c
76
 
@@ -30,7 +30,9 @@ __FBSDID("$FreeBSD$");
77
 
 
78
 
 #include <sys/param.h>
79
 
 #include <sys/mount.h>
80
 
+#ifdef HAVE_BSD_DISKLABEL
81
 
 #include <sys/disk.h>
82
 
+#endif
83
 
 #include <sys/disklabel.h>
84
 
 #include <sys/stat.h>
85