aboutsummaryrefslogtreecommitdiff
path: root/src/util/disk.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-09-28 09:32:00 +0000
committerChristian Grothoff <christian@grothoff.org>2012-09-28 09:32:00 +0000
commite83f734557f26abbb33ef1093767ec5c24a4bf56 (patch)
tree6a8733e031205a2c41f146ffd304c6400e3c51e6 /src/util/disk.c
parentd84be4e128a68baed1631736066f010c8dcf8643 (diff)
downloadgnunet-e83f734557f26abbb33ef1093767ec5c24a4bf56.tar.gz
gnunet-e83f734557f26abbb33ef1093767ec5c24a4bf56.zip
-simplify code structure for monkey
Diffstat (limited to 'src/util/disk.c')
-rw-r--r--src/util/disk.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/util/disk.c b/src/util/disk.c
index 5f0e15e13..7c346dded 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -274,9 +274,7 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, OFF_T offset,
274 LARGE_INTEGER new_pos; 274 LARGE_INTEGER new_pos;
275 BOOL b; 275 BOOL b;
276 276
277 static DWORD t[] = {[GNUNET_DISK_SEEK_SET] = FILE_BEGIN, 277 static DWORD t[] = { FILE_BEGIN, FILE_CURRENT, FILE_END };
278 [GNUNET_DISK_SEEK_CUR] = FILE_CURRENT,[GNUNET_DISK_SEEK_END] = FILE_END
279 };
280 li.QuadPart = offset; 278 li.QuadPart = offset;
281 279
282 b = SetFilePointerEx (h->h, li, &new_pos, t[whence]); 280 b = SetFilePointerEx (h->h, li, &new_pos, t[whence]);
@@ -287,9 +285,7 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, OFF_T offset,
287 } 285 }
288 return (OFF_T) new_pos.QuadPart; 286 return (OFF_T) new_pos.QuadPart;
289#else 287#else
290 static int t[] = {[GNUNET_DISK_SEEK_SET] = SEEK_SET, 288 static int t[] = { SEEK_SET, SEEK_CUR, SEEK_END };
291 [GNUNET_DISK_SEEK_CUR] = SEEK_CUR,[GNUNET_DISK_SEEK_END] = SEEK_END
292 };
293 289
294 return lseek (h->fd, offset, t[whence]); 290 return lseek (h->fd, offset, t[whence]);
295#endif 291#endif