From 4e07a2dea8c94337702d35d0d02d4b7234f86e29 Mon Sep 17 00:00:00 2001 From: Kostadin Damyanov Date: Mon, 25 May 2015 03:49:24 +0300 Subject: Haiku: fix building with UNIX_ENABLED. --- drivers/unix/stream_peer_tcp_posix.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'drivers/unix/stream_peer_tcp_posix.cpp') diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index 2301d8b6c4..2db7d9f6ec 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -39,7 +39,11 @@ #include #include #ifndef NO_FCNTL -#include + #ifdef __HAIKU__ + #include + #else + #include + #endif #else #include #endif @@ -202,7 +206,8 @@ Error StreamPeerTCPPosix::write(const uint8_t* p_data,int p_bytes, int &r_sent, while (data_to_send) { - int sent_amount = send(sockfd, offset, data_to_send, MSG_NOSIGNAL); + // TODO: handle MSG_NOSIGNAL on __HAIKU__ + int sent_amount = send(sockfd, offset, data_to_send, 0); //printf("Sent TCP data of %d bytes, errno %d\n", sent_amount, errno); if (sent_amount == -1) { -- cgit v1.2.3 From 826f8af1ef3311ddcc0fab27629f7a5fcfa1b024 Mon Sep 17 00:00:00 2001 From: Kostadin Damyanov Date: Mon, 25 May 2015 06:02:55 +0300 Subject: Haiku: link with the haiku libs, stub the OS_Haiku class. --- drivers/unix/stream_peer_tcp_posix.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/unix/stream_peer_tcp_posix.cpp') diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index 2db7d9f6ec..f65eb694d6 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -206,8 +206,12 @@ Error StreamPeerTCPPosix::write(const uint8_t* p_data,int p_bytes, int &r_sent, while (data_to_send) { - // TODO: handle MSG_NOSIGNAL on __HAIKU__ - int sent_amount = send(sockfd, offset, data_to_send, 0); + // TODO: haiku does not have MSG_NOSIGNAL +#ifdef __HAIKU__ + int sent_amount = send(sockfd, offset, data_to_send, 0); +#else + int sent_amount = send(sockfd, offset, data_to_send, MSG_NOSIGNAL); +#endif //printf("Sent TCP data of %d bytes, errno %d\n", sent_amount, errno); if (sent_amount == -1) { -- cgit v1.2.3 From a5533270436e51c660d2c196e2a6a8f9e21d6420 Mon Sep 17 00:00:00 2001 From: Kostadin Damyanov Date: Mon, 25 May 2015 06:34:16 +0300 Subject: Haiku: some small fixes --- drivers/unix/stream_peer_tcp_posix.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/unix/stream_peer_tcp_posix.cpp') diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index f65eb694d6..6e19647933 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -206,11 +206,10 @@ Error StreamPeerTCPPosix::write(const uint8_t* p_data,int p_bytes, int &r_sent, while (data_to_send) { - // TODO: haiku does not have MSG_NOSIGNAL #ifdef __HAIKU__ - int sent_amount = send(sockfd, offset, data_to_send, 0); + int sent_amount = send(sockfd, offset, data_to_send, 0); #else - int sent_amount = send(sockfd, offset, data_to_send, MSG_NOSIGNAL); + int sent_amount = send(sockfd, offset, data_to_send, MSG_NOSIGNAL); #endif //printf("Sent TCP data of %d bytes, errno %d\n", sent_amount, errno); -- cgit v1.2.3 From f99b72c04f484c39ae728bc175114544a26d7bca Mon Sep 17 00:00:00 2001 From: Kostadin Damyanov Date: Wed, 10 Jun 2015 21:18:39 +0300 Subject: Haiku: remove an #ifdef as the platform now supports MSG_NOSIGNAL --- drivers/unix/stream_peer_tcp_posix.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'drivers/unix/stream_peer_tcp_posix.cpp') diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index 6e19647933..5aa3915893 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -206,11 +206,7 @@ Error StreamPeerTCPPosix::write(const uint8_t* p_data,int p_bytes, int &r_sent, while (data_to_send) { -#ifdef __HAIKU__ - int sent_amount = send(sockfd, offset, data_to_send, 0); -#else int sent_amount = send(sockfd, offset, data_to_send, MSG_NOSIGNAL); -#endif //printf("Sent TCP data of %d bytes, errno %d\n", sent_amount, errno); if (sent_amount == -1) { -- cgit v1.2.3