]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - support/sdk/cpp/sf/sfcontrol.cpp
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / support / sdk / cpp / sf / sfcontrol.cpp
index 1920949d936306cc3c59e94bdb2c039c898404a5..8489d0b2d5f743052280a0dede6bdd9e446e9aff 100644 (file)
@@ -42,6 +42,8 @@
 #include <fcntl.h>
 
 #include <string>
+#include <cstdlib>
+#include <cstring>
 #include <iostream>
 #include <sstream>
 #include <fstream>
@@ -452,7 +454,11 @@ bool SFControl::sendToClient(string message)
     const char* buffer = message.c_str();
     while (length > 0)
     {
+#ifdef __APPLE__
+        int n = send(clientFD, buffer, length, 0);
+#else
         int n = send(clientFD, buffer, length, MSG_NOSIGNAL);
+#endif
         if (!(n > 0))
         {
             return false;
@@ -491,7 +497,7 @@ void SFControl::waitOnInput()
     bool clientConnected = false;
 
     struct sockaddr_in client;
-    unsigned int clientAddrLen = sizeof(client);
+    socklen_t clientAddrLen = sizeof(client);
     FD_ZERO(&rfds);
 
     while (true)