aboutsummaryrefslogtreecommitdiff
path: root/src/util/disk.c
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2013-10-08 09:30:27 +0000
committerLRN <lrn1986@gmail.com>2013-10-08 09:30:27 +0000
commit3e996078dc075428545ac4646937f437a02802cb (patch)
tree50a5a9ccb3b9c738deffdadea08dea691ad1def8 /src/util/disk.c
parentfecec16a940ab10dd028385d09bf3c31c5f85739 (diff)
downloadgnunet-3e996078dc075428545ac4646937f437a02802cb.tar.gz
gnunet-3e996078dc075428545ac4646937f437a02802cb.zip
Replace OFF_T with off_t
Diffstat (limited to 'src/util/disk.c')
-rw-r--r--src/util/disk.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/util/disk.c b/src/util/disk.c
index 652a45ed0..8dc1e35bf 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -208,7 +208,7 @@ GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h)
208 */ 208 */
209int 209int
210GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh, 210GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh,
211 OFF_T *size) 211 off_t *size)
212{ 212{
213#if WINDOWS 213#if WINDOWS
214 BOOL b; 214 BOOL b;
@@ -219,7 +219,7 @@ GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh,
219 SetErrnoFromWinError (GetLastError ()); 219 SetErrnoFromWinError (GetLastError ());
220 return GNUNET_SYSERR; 220 return GNUNET_SYSERR;
221 } 221 }
222 *size = (OFF_T) li.QuadPart; 222 *size = (off_t) li.QuadPart;
223#else 223#else
224 struct stat sbuf; 224 struct stat sbuf;
225 225
@@ -239,8 +239,8 @@ GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh,
239 * @param whence specification to which position the offset parameter relates to 239 * @param whence specification to which position the offset parameter relates to
240 * @return the new position on success, GNUNET_SYSERR otherwise 240 * @return the new position on success, GNUNET_SYSERR otherwise
241 */ 241 */
242OFF_T 242off_t
243GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, OFF_T offset, 243GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, off_t offset,
244 enum GNUNET_DISK_Seek whence) 244 enum GNUNET_DISK_Seek whence)
245{ 245{
246 if (h == NULL) 246 if (h == NULL)
@@ -263,7 +263,7 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, OFF_T offset,
263 SetErrnoFromWinError (GetLastError ()); 263 SetErrnoFromWinError (GetLastError ());
264 return GNUNET_SYSERR; 264 return GNUNET_SYSERR;
265 } 265 }
266 return (OFF_T) new_pos.QuadPart; 266 return (off_t) new_pos.QuadPart;
267#else 267#else
268 static int t[] = { SEEK_SET, SEEK_CUR, SEEK_END }; 268 static int t[] = { SEEK_SET, SEEK_CUR, SEEK_END };
269 269
@@ -1529,8 +1529,8 @@ GNUNET_DISK_file_change_owner (const char *filename, const char *user)
1529 * @return GNUNET_OK on success, GNUNET_SYSERR on error 1529 * @return GNUNET_OK on success, GNUNET_SYSERR on error
1530 */ 1530 */
1531int 1531int
1532GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, OFF_T lock_start, 1532GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lock_start,
1533 OFF_T lock_end, int excl) 1533 off_t lock_end, int excl)
1534{ 1534{
1535 if (fh == NULL) 1535 if (fh == NULL)
1536 { 1536 {
@@ -1550,7 +1550,7 @@ GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, OFF_T lock_start,
1550 return fcntl (fh->fd, F_SETLK, &fl) != 0 ? GNUNET_SYSERR : GNUNET_OK; 1550 return fcntl (fh->fd, F_SETLK, &fl) != 0 ? GNUNET_SYSERR : GNUNET_OK;
1551#else 1551#else
1552 OVERLAPPED o; 1552 OVERLAPPED o;
1553 OFF_T diff = lock_end - lock_start; 1553 off_t diff = lock_end - lock_start;
1554 DWORD diff_low, diff_high; 1554 DWORD diff_low, diff_high;
1555 diff_low = (DWORD) (diff & 0xFFFFFFFF); 1555 diff_low = (DWORD) (diff & 0xFFFFFFFF);
1556 diff_high = (DWORD) ((diff >> (sizeof (DWORD) * 8)) & 0xFFFFFFFF); 1556 diff_high = (DWORD) ((diff >> (sizeof (DWORD) * 8)) & 0xFFFFFFFF);
@@ -1580,8 +1580,8 @@ GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, OFF_T lock_start,
1580 * @return GNUNET_OK on success, GNUNET_SYSERR on error 1580 * @return GNUNET_OK on success, GNUNET_SYSERR on error
1581 */ 1581 */
1582int 1582int
1583GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, OFF_T unlock_start, 1583GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, off_t unlock_start,
1584 OFF_T unlock_end) 1584 off_t unlock_end)
1585{ 1585{
1586 if (fh == NULL) 1586 if (fh == NULL)
1587 { 1587 {
@@ -1601,7 +1601,7 @@ GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, OFF_T unlock_start,
1601 return fcntl (fh->fd, F_SETLK, &fl) != 0 ? GNUNET_SYSERR : GNUNET_OK; 1601 return fcntl (fh->fd, F_SETLK, &fl) != 0 ? GNUNET_SYSERR : GNUNET_OK;
1602#else 1602#else
1603 OVERLAPPED o; 1603 OVERLAPPED o;
1604 OFF_T diff = unlock_end - unlock_start; 1604 off_t diff = unlock_end - unlock_start;
1605 DWORD diff_low, diff_high; 1605 DWORD diff_low, diff_high;
1606 diff_low = (DWORD) (diff & 0xFFFFFFFF); 1606 diff_low = (DWORD) (diff & 0xFFFFFFFF);
1607 diff_high = (DWORD) ((diff >> (sizeof (DWORD) * 8)) & 0xFFFFFFFF); 1607 diff_high = (DWORD) ((diff >> (sizeof (DWORD) * 8)) & 0xFFFFFFFF);