From: RĂ©mi Denis-Courmont Date: Sat, 8 Sep 2012 16:12:21 +0000 (+0300) Subject: Remove buggy and unused pread()/pwrite() X-Git-Tag: 2.1.0-git~2992 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=63c78d400b682b650da19a91bf358a1a6e12f8d2;p=vlc Remove buggy and unused pread()/pwrite() If they are really needed, they should be integrated in compat/. Declaring standard functions static breaks when the target has stubs. --- diff --git a/src/misc/block.c b/src/misc/block.c index 1962ff5eb9..e4850e0aaf 100644 --- a/src/misc/block.c +++ b/src/misc/block.c @@ -355,28 +355,6 @@ ssize_t pread (int fd, void *buf, size_t count, off_t offset) return written; return -1; } -#elif !defined( HAVE_PREAD ) -static -ssize_t pread(int fd, const void * buf, size_t size, off_t offset) { - off_t offs0; - ssize_t rd; - if ((offs0 = lseek(fd, 0, SEEK_CUR)) == (off_t)-1) return -1; - if (lseek(fd, offset, SEEK_SET) == (off_t)-1) return -1; - rd = read(fd, (void *)buf, size); - if (lseek(fd, offs0, SEEK_SET) == (off_t)-1) return -1; - return rd; -} - -static -ssize_t pwrite(int fd, const void * buf, size_t size, off_t offset) { - off_t offs0; - ssize_t wr; - if ((offs0 = lseek(fd, 0, SEEK_CUR)) == (off_t)-1) return -1; - if (lseek(fd, offset, SEEK_SET) == (off_t)-1) return -1; - wr = write(fd, (void *)buf, size); - if (lseek(fd, offs0, SEEK_SET) == (off_t)-1) return -1; - return wr; -} #endif /**