comparison audioDB-internals.h @ 592:cfa74bcc1249

Remove uses of mmap() from open.cpp (These are relatively easy to deal with; just replace them with an lseek()/read() pair. Of course, now we're destructively modifying the fd position; I'd have liked to use pread() but, surprise, that's not available on mingw.)
author mas01cr
date Tue, 11 Aug 2009 21:42:29 +0000
parents 0242e5d1643c
children 31a1556fc2d6
comparison
equal deleted inserted replaced
591:0242e5d1643c 592:cfa74bcc1249
190 if(read(fd, buffer, size) != tmp) { \ 190 if(read(fd, buffer, size) != tmp) { \
191 goto error; \ 191 goto error; \
192 } \ 192 } \
193 } 193 }
194 194
195 #define lseek_set_or_goto_error(fd, offset) \
196 { if(lseek(fd, offset, SEEK_SET) == (off_t) -1) \
197 goto error; \
198 } \
199
195 static inline int audiodb_sync_header(adb_t *adb) { 200 static inline int audiodb_sync_header(adb_t *adb) {
196 off_t pos; 201 off_t pos;
197 pos = lseek(adb->fd, (off_t) 0, SEEK_CUR); 202 pos = lseek(adb->fd, (off_t) 0, SEEK_CUR);
198 if(pos == (off_t) -1) { 203 if(pos == (off_t) -1) {
199 goto error; 204 goto error;