mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
Fix bugs in libc_noux's sendto() method
The sysio's struct fields need to be properly set on each syscall. This fixes a bug where the wrong fd is used after the first sendto syscall. Also the minimal buffer size calculation uses the wrong size. Fixes #235.
This commit is contained in:
parent
c02f04da76
commit
7e3c303ad0
@ -1373,7 +1373,6 @@ namespace {
|
||||
return -1;
|
||||
}
|
||||
|
||||
sysio()->sendto_in.fd = noux_fd(fd->context);
|
||||
sysio()->sendto_in.addrlen = addrlen;
|
||||
Genode::memcpy(&sysio()->sendto_in.dest_addr, dest_addr, addrlen);
|
||||
|
||||
@ -1382,8 +1381,9 @@ namespace {
|
||||
|
||||
char *src = (char *)buf;
|
||||
while (len > 0) {
|
||||
size_t curr_len = Genode::min(sizeof *sysio()->sendto_in.buf, len);
|
||||
size_t curr_len = Genode::min(sizeof (sysio()->sendto_in.buf), len);
|
||||
|
||||
sysio()->sendto_in.fd = noux_fd(fd->context);
|
||||
sysio()->sendto_in.len = curr_len;
|
||||
Genode::memcpy(sysio()->sendto_in.buf, src, curr_len);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user