aboutsummaryrefslogtreecommitdiffstats
path: root/main/open-vm-tools/0013-use-off64_t-instead-of-loff_t.patch
blob: 22780bdc1bcf5eae3f9a1cb0bba3fdf7dcc3f6bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
From 2c0e1ca2f797362f567cfde74060fd9a51c4182c Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Mon, 2 Jan 2017 15:25:32 +0000
Subject: [PATCH 13/14] use off64_t instead of loff_t

---
 open-vm-tools/vmhgfs-fuse/file.c   | 12 ++++++------
 open-vm-tools/vmhgfs-fuse/fsutil.c |  2 +-
 open-vm-tools/vmhgfs-fuse/fsutil.h |  8 ++------
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/open-vm-tools/vmhgfs-fuse/file.c b/open-vm-tools/vmhgfs-fuse/file.c
index bb463b4d..b3872d18 100644
--- a/open-vm-tools/vmhgfs-fuse/file.c
+++ b/open-vm-tools/vmhgfs-fuse/file.c
@@ -535,7 +535,7 @@ static int
 HgfsDoRead(HgfsHandle handle,  // IN:  Handle for this file
            char *buf,          // OUT: Buffer to copy data into
            size_t count,       // IN:  Number of bytes to read
-           loff_t offset)      // IN:  Offset at which to read
+           off64_t offset)      // IN:  Offset at which to read
 {
    HgfsReq *req;
    HgfsOp opUsed;
@@ -668,11 +668,11 @@ ssize_t
 HgfsRead(struct fuse_file_info *fi,  // IN:  File info struct
          char  *buf,                 // OUT: User buffer to copy data into
          size_t count,               // IN:  Number of bytes to read
-         loff_t offset)              // IN:  Offset at which to read
+         off64_t offset)              // IN:  Offset at which to read
 {
    int result = 0;
    char *buffer = buf;
-   loff_t curOffset = offset;
+   off64_t curOffset = offset;
    size_t nextCount, remainingCount = count;
 
    ASSERT(NULL != fi);
@@ -729,7 +729,7 @@ static int
 HgfsDoWrite(HgfsHandle handle,       // IN: Handle for the file
             const char *buf,         // IN: Buffer containing data
             size_t count,            // IN: Number of bytes to write
-            loff_t offset)           // IN: Offset to begin writing at
+            off64_t offset)           // IN: Offset to begin writing at
 {
    HgfsReq *req;
    int result = 0;
@@ -853,11 +853,11 @@ ssize_t
 HgfsWrite(struct fuse_file_info *fi,  // IN: File info structure
          const char  *buf,            // OUT: User buffer to copy data into
          size_t count,                // IN:  Number of bytes to read
-         loff_t offset)               // IN:  Offset at which to read
+         off64_t offset)               // IN:  Offset at which to read
 {
    int result;
    const char *buffer = buf;
-   loff_t curOffset = offset;
+   off64_t curOffset = offset;
    size_t nextCount, remainingCount = count;
    ssize_t bytesWritten = 0;
 
diff --git a/open-vm-tools/vmhgfs-fuse/fsutil.c b/open-vm-tools/vmhgfs-fuse/fsutil.c
index 042c223c..c3d581d3 100644
--- a/open-vm-tools/vmhgfs-fuse/fsutil.c
+++ b/open-vm-tools/vmhgfs-fuse/fsutil.c
@@ -680,7 +680,7 @@ HgfsStatusConvertToLinux(HgfsStatus hgfsStatus) // IN: Status code to convert
 unsigned long
 HgfsCalcBlockSize(uint64 tsize)
 {
-   loff_t used = (tsize + 511) >> 9;
+   off64_t used = (tsize + 511) >> 9;
    return (used > ULONG_MAX) ? ULONG_MAX : used;
 }
 
diff --git a/open-vm-tools/vmhgfs-fuse/fsutil.h b/open-vm-tools/vmhgfs-fuse/fsutil.h
index 34b6d489..a75cff82 100644
--- a/open-vm-tools/vmhgfs-fuse/fsutil.h
+++ b/open-vm-tools/vmhgfs-fuse/fsutil.h
@@ -32,10 +32,6 @@
 #include "hgfsProto.h"
 #include <fuse.h>
 
-#if defined(__FreeBSD__) || defined(__SOLARIS__) || defined(__APPLE__)
-typedef long long loff_t;
-#endif
-
 /*
  * Struct used to pass around attributes.
  * These aren't just the attributes seen in HgfsAttr[V2]; we add a filename
@@ -73,7 +69,7 @@ ssize_t
 HgfsWrite(struct fuse_file_info *fi,
           const char  *buf,
           size_t count,
-          loff_t offset);
+          off64_t offset);
 
 int
 HgfsRename(const char* from, const char* to);
@@ -93,7 +89,7 @@ ssize_t
 HgfsRead(struct fuse_file_info *fi,
          char  *buf,
          size_t count,
-         loff_t offset);
+         off64_t offset);
 
 int
 HgfsSetattr(const char* path,
-- 
2.11.0