diff options
Diffstat (limited to 'slof/ppc64.c')
-rw-r--r-- | slof/ppc64.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/slof/ppc64.c b/slof/ppc64.c index 83a8e82..ca6caff 100644 --- a/slof/ppc64.c +++ b/slof/ppc64.c @@ -144,6 +144,12 @@ int socket(int domain, int type, int proto, char *mac_addr) int prop_len; int fd; + if (!(domain == AF_INET || domain == AF_INET6)) + return -1; + + if (type != SOCK_DGRAM || proto != 0) + return -1; + /* search free file descriptor (and skip stdio handlers) */ for (fd = 3; fd < FILEIO_MAX; ++fd) { if (fd_array[fd].type == FILEIO_TYPE_EMPTY) { @@ -217,7 +223,7 @@ int close(int fd) */ int recv(int fd, void *buf, int len, int flags) { - if (!is_valid_fd(fd)) + if (!is_valid_fd(fd) || flags) return -1; forth_push((unsigned long)buf); @@ -237,7 +243,7 @@ int recv(int fd, void *buf, int len, int flags) */ int send(int fd, const void *buf, int len, int flags) { - if (!is_valid_fd(fd)) + if (!is_valid_fd(fd) || flags) return -1; forth_push((unsigned long)buf); @@ -258,7 +264,7 @@ int send(int fd, const void *buf, int len, int flags) ssize_t read(int fd, void *buf, size_t len) { char *ptr = (char *)buf; - int cnt = 0; + unsigned cnt = 0; char code; if (fd == 0 || fd == 2) { |