posix: unix_sendto() zero length fix
JIRA:
@@ -648,6 +648,7 @@ ssize_t unix_sendto(unsigned socket, const void *message, size_t length, int fla
err = 0;
+ if (length > 0) {
for (;;) {
proc_lockSet(&conn->lock);
if (s->type == SOCK_STREAM) {
@@ -656,7 +657,6 @@ ssize_t unix_sendto(unsigned socket, const void *message, size_t length, int fla
else if (_cbuffer_free(&conn->buffer) >= length + sizeof(length)) {
_cbuffer_write(&conn->buffer, &length, sizeof(length));
_cbuffer_write(&conn->buffer, message, err = length);
- proc_threadWakeup(&conn->queue);
}
proc_lockClear(&conn->lock);
@@ -676,6 +676,7 @@ ssize_t unix_sendto(unsigned socket, const void *message, size_t length, int fla
proc_threadWait(&conn->writeq, &conn->spinlock, 0, &sc);
hal_spinlockClear(&conn->spinlock, &sc);
}
+ }
if (s->type == SOCK_DGRAM && dest_addr && dest_len != 0)
unixsock_put(conn);
