Few fixes in libposix error checking.

size_t is a non-negative type and negative error checking didn't work. Now fixed.
Fixed various issues with reading file pages in the sys_read() path.
This commit is contained in:
Bahadir Balban
2008-04-20 02:12:53 +01:00
parent 8b3fedc18d
commit 9992d100d7
6 changed files with 33 additions and 27 deletions

View File

@@ -18,7 +18,7 @@
static inline int l4_readdir(int fd, void *buf, size_t count)
{
size_t cnt;
int cnt;
write_mr(L4SYS_ARG0, fd);
write_mr(L4SYS_ARG1, (unsigned long)utcb_page);
@@ -31,7 +31,7 @@ static inline int l4_readdir(int fd, void *buf, size_t count)
}
/* Check if syscall itself was successful */
if ((cnt = l4_get_retval()) < 0) {
printf("%s: READ Error: %d.\n", __FUNCTION__, (int)cnt);
printf("%s: READDIR Error: %d.\n", __FUNCTION__, (int)cnt);
return cnt;
}
@@ -42,7 +42,7 @@ static inline int l4_readdir(int fd, void *buf, size_t count)
static inline int l4_read(int fd, void *buf, size_t count)
{
size_t cnt;
int cnt;
write_mr(L4SYS_ARG0, fd);
write_mr(L4SYS_ARG1, (unsigned long)buf);

View File

@@ -13,7 +13,7 @@
static inline int l4_write(int fd, const void *buf, size_t count)
{
size_t wrcnt;
int wrcnt;
write_mr(L4SYS_ARG0, fd);
write_mr(L4SYS_ARG1, (const unsigned long)buf);