Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/77ffda1e46d602fa1efc6...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/77ffda1e46d602fa1efc6ea...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/77ffda1e46d602fa1efc6eac0...
The branch, master has been updated
via 77ffda1e46d602fa1efc6eac0e7c4f97f4dfbae1 (commit)
via 47d08b6506a16b1d8a806d9dfa971398553a250e (commit)
from 576b1c55bf5a8b37983e1581a6c0cc1a9d7158f5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=77ffda1e46d602fa1ef...
commit 77ffda1e46d602fa1efc6eac0e7c4f97f4dfbae1
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Use nsutils unistd operations for pread and pwrite to get consistant interface
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index f884a74..21b42f2 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -43,6 +43,7 @@
#include <errno.h>
#include <time.h>
#include <stdlib.h>
+#include <nsutils/unistd.h>
#include "utils/filepath.h"
#include "utils/file.h"
@@ -1597,7 +1598,7 @@ static nserror store_write_block(struct store_state *state,
offst = bi << log2_block_size[elem_idx];
- wr = pwrite(state->blocks[elem_idx][bf].fd,
+ wr = nsu_pwrite(state->blocks[elem_idx][bf].fd,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
@@ -1753,7 +1754,7 @@ static nserror store_read_block(struct store_state *state,
offst = bi << log2_block_size[elem_idx];
- rd = pread(state->blocks[elem_idx][bf].fd,
+ rd = nsu_pread(state->blocks[elem_idx][bf].fd,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=47d08b6506a16b1d8a8...
commit 47d08b6506a16b1d8a806d9dfa971398553a250e
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Revert "Fix RISC OS not having a pread/pwrite implementation."
This reverts commit 82c7a7a4baf4a7a15381ee720799dc41c3d54909.
Conflicts:
content/fs_backing_store.c
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 638a109..f884a74 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -35,8 +35,6 @@
*
*/
-#include "utils/config.h"
-
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
diff --git a/utils/config.h b/utils/config.h
index cfb9d83..2af38c0 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -59,19 +59,6 @@ char *strcasestr(const char *haystack, const char *needle);
char *strchrnul(const char *s, int c);
#endif
-/* Although these are in POSIX and implemented most places, RISC OS is
- * missing them.
- */
-#if (defined(riscos))
-#undef HAVE_PREAD
-#undef HAVE_PWRITE
-ssize_t pread(int fd, void *buf, size_t count, off_t offset);
-ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
-#else
-#define HAVE_PREAD
-#define HAVE_PWRITE
-#endif
-
#define HAVE_SYS_SELECT
#define HAVE_INETATON
#if (defined(_WIN32))
diff --git a/utils/utils.c b/utils/utils.c
index 722e323..5c8acd6 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -32,7 +32,6 @@
#include <regex.h>
#include <time.h>
#include <errno.h>
-#include <unistd.h>
#include "utils/config.h"
#include "utils/log.h"
@@ -629,34 +628,3 @@ nserror nsc_snptimet(char *str, size_t size, time_t *timep)
return NSERROR_OK;
}
-
-#ifndef HAVE_PREAD
-
-ssize_t pread(int fd, void *buf, size_t count, off_t offset)
-{
- off_t sk;
-
- sk = lseek(fd, offset, SEEK_SET);
- if (sk == -1) {
- return (off_t)-1;
- }
- return read(fd, buf, count);
-}
-
-#endif
-
-
-#ifndef HAVE_PWRITE
-
-ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
-{
- off_t sk;
-
- sk = lseek(fd, offset, SEEK_SET);
- if (sk == (off_t)-1) {
- return -1;
- }
- return write(fd, buf, count);
-}
-
-#endif
-----------------------------------------------------------------------
Summary of changes:
content/fs_backing_store.c | 7 +++----
utils/config.h | 13 -------------
utils/utils.c | 32 --------------------------------
3 files changed, 3 insertions(+), 49 deletions(-)
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 638a109..21b42f2 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -35,8 +35,6 @@
*
*/
-#include "utils/config.h"
-
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
@@ -45,6 +43,7 @@
#include <errno.h>
#include <time.h>
#include <stdlib.h>
+#include <nsutils/unistd.h>
#include "utils/filepath.h"
#include "utils/file.h"
@@ -1599,7 +1598,7 @@ static nserror store_write_block(struct store_state *state,
offst = bi << log2_block_size[elem_idx];
- wr = pwrite(state->blocks[elem_idx][bf].fd,
+ wr = nsu_pwrite(state->blocks[elem_idx][bf].fd,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
@@ -1755,7 +1754,7 @@ static nserror store_read_block(struct store_state *state,
offst = bi << log2_block_size[elem_idx];
- rd = pread(state->blocks[elem_idx][bf].fd,
+ rd = nsu_pread(state->blocks[elem_idx][bf].fd,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
diff --git a/utils/config.h b/utils/config.h
index cfb9d83..2af38c0 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -59,19 +59,6 @@ char *strcasestr(const char *haystack, const char *needle);
char *strchrnul(const char *s, int c);
#endif
-/* Although these are in POSIX and implemented most places, RISC OS is
- * missing them.
- */
-#if (defined(riscos))
-#undef HAVE_PREAD
-#undef HAVE_PWRITE
-ssize_t pread(int fd, void *buf, size_t count, off_t offset);
-ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
-#else
-#define HAVE_PREAD
-#define HAVE_PWRITE
-#endif
-
#define HAVE_SYS_SELECT
#define HAVE_INETATON
#if (defined(_WIN32))
diff --git a/utils/utils.c b/utils/utils.c
index 722e323..5c8acd6 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -32,7 +32,6 @@
#include <regex.h>
#include <time.h>
#include <errno.h>
-#include <unistd.h>
#include "utils/config.h"
#include "utils/log.h"
@@ -629,34 +628,3 @@ nserror nsc_snptimet(char *str, size_t size, time_t *timep)
return NSERROR_OK;
}
-
-#ifndef HAVE_PREAD
-
-ssize_t pread(int fd, void *buf, size_t count, off_t offset)
-{
- off_t sk;
-
- sk = lseek(fd, offset, SEEK_SET);
- if (sk == -1) {
- return (off_t)-1;
- }
- return read(fd, buf, count);
-}
-
-#endif
-
-
-#ifndef HAVE_PWRITE
-
-ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
-{
- off_t sk;
-
- sk = lseek(fd, offset, SEEK_SET);
- if (sk == (off_t)-1) {
- return -1;
- }
- return write(fd, buf, count);
-}
-
-#endif
--
NetSurf Browser